% interprets one line of MG raw data
%  mastmp,mistmp;deg,.deg
% 44140,3579772455;25,0;;
% 44140.3579772455 25.0
% returns timevector time[s] temperature[C] in each point
% Mysa 09. 11. 2020
function [ctimv, tss, ctemp]=mami0(cline)
datbase=693960; % date number of 30. 12. 1899 (1. 1. 1900)
kk=100000/86400;
%cline='44140,3579772455;25,0;';
%cline='44140,3582628239;25,2;';
%cline=deblank(cline);
cline(cline==',')=' ';
cline(cline==';')=' ';
ble=textscan(cline,'%s %s %s %s'); % mastmp mistmp tdeg .tdeg
tes=[char(ble{3}),'.',char(ble{4})]; ctemp=eval(tes);
mastmp=eval(char(ble{1}));
mistmp=eval(['0.',char(ble{2})]);
dates=datestr(datenum(datbase+mastmp));
tss=1e5*mistmp/kk;
times=datestr(datenum([0 0 0 0 0 tss+1]),0);
cdatv=datevec(datenum(datbase+mastmp));
csecv=datevec(datenum([0 0 0 0 0 tss+1]));
ctimv=cdatv+csecv;
% disp('Here I am!');