- there are routines in the Financial Toolbox or File Exchange to convert the numbers from Excel format to datenum
- datetime() with 'convertfrom' excel options
- use readtable() instead of xlsread, which in r2014b and later will automatically convert them to datetime objects.
[solved] - xlsread on linux read dates as numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
yari lazzaro
am 15 Okt. 2018
Kommentiert: yari lazzaro
am 16 Okt. 2018
Hi, I'm using xlsread to read the content of an .xlsx file
[data,text]=xlsread('MSCIandFX.xlsx','MSCIPI');
it sort of works but it's treating all the dates as numbers. I tried the same on a windows machine and the dates where treated as text and thus appeared under the data variable.
Can someone give their interpretation of what's going on and what's the best way to handle this situation?
edit: for example the date "12/31/1987" is imported in matlab as 32142 which is the same value I see on OpenOffice when converting that same date to text format in the xlsx file. I am attaching the file I'm using
Thanks
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 15 Okt. 2018
This is documented. On Windows with Excel installed, MATLAB uses ActiveX to talk to excel, and has full functionality. Any other configuration is restricted to 'basic' mode.
You have a few choices:
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!