Import excel file destroy the date vector and convert them to numeric number

1 vue (au cours des 30 derniers jours)
Moshe
Moshe le 19 Août 2016
Réponse apportée : Guillaume le 19 Août 2016
I am using matlab 2014a on Macintosh, when i am import Excel file into MATLAB the dates vector destroy and convert it to numeric number. when i do the same on PC the dates in the excel file stay the same as date and not destroy. what is the problem why there is different between the PC and the macintosh, and how i can fix it to work good on Macintosh.
code i am using:
File_Name ='SPX_Index.xlsx'; Load_DATA=dataset('XLSFIle',File_Name,'sheet',1);
thanks

Réponses (1)

Guillaume
Guillaume le 19 Août 2016
On a Windows computer with excel installed, matlab talks directly to excel to load the file. On a Windows computer without excel installed or on non-Windows computer this is not possible and a completely different method is used to load excel files. Matlab parses the file directly instead.
A downside of that is that indeed, excel dates are imported as excel serial date numbers. Here is a post on how to convert these numbers back to dates.

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by