MATLAB Answers

matlab datenum to excel datetime

43 views (last 30 days)
Adam
Adam on 20 Feb 2013
Hello Forum, This might really be an Excel question, but is there an Excel method that converts the Matlab datenum to an Excel date time, in Excel?
Thanks

  0 Comments

Sign in to comment.

Answers (3)

Azzi Abdelmalek
Azzi Abdelmalek on 20 Feb 2013
Edited: Azzi Abdelmalek on 20 Feb 2013
That mean you are exporting your data from Matlab to Excell, then you can set the format you need in Matlab and export it to Excell file. Example
yourdates=datestr(datenum(2013,1,(1:365)),'dd-mmm-yyyy')
xlswrite('file.xls',cellstr(yourdates))
Then in Excell you can use other formats

  0 Comments

Sign in to comment.


Oleg Komarov
Oleg Komarov on 20 Feb 2013
In MATLAB you can convert MATLAB datenums into EXCEL datenums with the function m2xdate(). Then export to excel and set the column with the serial dates to type date.

  0 Comments

Sign in to comment.


Jan
Jan on 20 Feb 2013
What kind of "Excel date time" do you mean? The serial date number? See:
Please note, that Excel uses another start point for the serial datenumbers when run on Macs, 1904 instead of 1900. Isn't this cute?

  0 Comments

Sign in to comment.

Sign in to answer this question.