1) I have 6 variables, ref_year,mth,day,hr,min,sec that corresponds to a reference time. I am having trouble getting MATLAB to recognise it as a date vector when I put them into a single 1x6 matrix. How could I convert them into a datenum?
If an element falls outside the conventional range, datenum adjusts both that date vector element and the previous element. For example, if the minutes element is 70, datenum adjusts the hours element by 1 and sets the minutes element to 10. If the minutes element is -15, then datevec decreases the hours element by 1 and sets the minutes element to 45. Month values are an exception. datenum sets month values less than 1 to 1.