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

1 次查看(过去 30 天)
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

回答(1 个)

Guillaume
Guillaume 2016-8-19
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.

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by