1 function t=add_datenum(t)
4 % add start and end times in datenum format
6 t.end_datenum = datenum(t.times(end,:)); % in days from some instant in the past
7 end_minutes=t.xtime(end); % from simulation start
8 t.start_datenum=t.end_datenum-end_minutes/(24*60);
9 t.tign_datenum = t.tign_g/82800+t.start_datenum;