MATLAB: Converting yyyymmdd date to matlab date number date I have a column of dates that have the following format: 19940127 how can i get a matlab number that corresponds to 01/27/1994? Best Answer For each date, use a command like this:datestr(datenum('19940127','yyyymmdd'),'mm/dd/yyyy') Related SolutionsMATLAB: Converting number to date number One approach:dd = 19940127;out = datestr(datenum(num2str(dd, '%d'), 'yyyymmdd'), 'yyyy/mm/dd')out =1994/01/27To get the date number, just use part of that:out_dn = datenum(num2str(dd, '%d'), 'yyyymmdd')EDIT — Added ‘out_dn’. MATLAB: Converting date to matlab date You need to pass in a string for datenumdatenum('20100815', 'yyyymmdd') Related QuestionConvert date to datetimeConverting numeric elements to dateDate ConversionVector of dates going back one rolling year
Best Answer