This project is read-only.

IRIS dates to Matlab dates

Topics: Dates
Aug 22, 2014 at 10:15 PM

I'm using a package that requires dates to be in string format ie '1985-01-01'. Now is there a way to convert monthly or quarterly IRIS dates to that format?

I've been trying:
DataXdate = dat2str(mm(1981,1):mm(2014,3),'dateFormat','YYYY-MM-DD')
DataXdate = strcat(DataXdate, '01')
It works but is not very elegant. Is there a better way?
Aug 22, 2014 at 10:29 PM
In general using sprintf() is much faster tan using strcat(). I don't know about more elegant.
Aug 22, 2014 at 10:35 PM
This will do the job:
DataXdate = dat2str(mm(1981,1):mm(2014,3),'dateFormat','YYYY-MM-01')
Marked as answer by jaromirbenes on 8/22/2014 at 2:35 PM
Aug 22, 2014 at 10:38 PM
Very nice!