xlsread is importing the date strings as a serial date in my mac script but not on my windows script
조회 수: 1 (최근 30일)
이전 댓글 표시
I've been writing a script on my mac using matlab R2015b (same version on windows) to import a large spreadsheet and it imports fine on my mac with the date strings converted to serial number. When I load the same script to my windows OS it will not read the date strings nor convert them. I have tried several way around [num, txt, raw] and and manipulating it that way however, I have found that the date vector has been very odd and was thinking there might be some setting that is awry.
If anyone can help that would be much appreciated.
댓글 수: 1
Walter Roberson
2015년 12월 30일
I wonder if you could extract a small portion and post the file? Say one column with the date and one column with numeric, and perhaps 3 rows.
채택된 답변
Jon Brenner
2016년 1월 4일
편집: Jon Brenner
2016년 1월 6일
Hi Thomas,
xlsread behaves differently on Macs than on Windows. I think what you need is xlsread's 'basic' mode. 'basic' mode will return Excel serial date numbers on all platforms.
>> [num, txt, raw] = xlsread('myfile.xlsx', 1, '', 'basic');
Call "help xlsread" or "doc xlsread" for more details on how to use xlsread.
추가 답변 (1개)
Rahul Goel
2016년 1월 4일
Hi Thomas,
The community will be able to help you better if you could share a sample code and the output of your script both on mac and windows.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!