MATLAB: Converting dates into numbers

cell arraycombineconversiondatesformattinghh:mmint32MATLAByyyymmdd

I have a int32 matrix of dates in the format YYYYMMDD and a cell array for time in the day in the format HH:MM. How can I combine both and turn it into a number I can use for plotting?

Best Answer

x=int32([19921212,19921213,19921214])'
y={'12:12', '13:13','14:14'}'
a=[num2str(x) char(y)]
b=datenum(a,'yyyymmddHH:MM')
datestr(b)