Import excel file destroy the date vector and convert them to numeric number
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Guillaume
on 19 Aug 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.
0 Comments
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!