Problem to import data from Excel to Matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I've a problem to import data from excel file to Matlab. I'm using xlsread function in the following way:
[num,text]=xlsread('myxlsfile.xls')
then I receive this warning message:
"Warning: XLS File contains unrecognized string header - skipping remaining text - (1027:0x20 57307)"
and the 'text' matrix result truncate. I've tried to copy and paste the data in an other xls file, but the problem persist. My xls file is approximately 20MB.
Is it too large? Could anyone help me?
Thank you
Maddalena
댓글 수: 6
Image Analyst
2011년 6월 12일
Well there's your problem - you installed Excel 2011 on your Windows 7 computer. I didn't even know you could do that since that's a Apple Macintosh product. The latest Excel for Windows is 2010, while for the Macintosh it's 2011. Try installing Office 2010 for Windows instead. ;-)
Can you open that file in any version of Excel on any platform? It seems if it's a corrupt workbook with a corrupt header that even Excel wouldn't open it.
채택된 답변
Kaustubha Govind
2011년 6월 12일
On Windows machine, MATLAB opens Excel as a COM server to read data from Excel files. On other platforms, xlsread operates in what is called a 'basic' mode, which doesn't support some file formats. From the warning message that you receive: "Range cannot be used in 'basic' mode. The entire sheet will be loaded.", it seems that MATLAB is somehow unable to start-up Excel as a COM server. So the best path of resolution to your issue is to first resolve any errors occurring while starting Excel as a COM server.
Try executing the following command to see if you receive an error:
e = actxserver('Excel.Application')
댓글 수: 11
Kokalz
2012년 7월 16일
Could you give a full discription on the problem solving steps that your performed? Thank you!
추가 답변 (2개)
Guido Travaglini
2011년 6월 12일
Make sure the path shown in the "Current Folder" window is the same where your XLS file resides.
Kokalz
2012년 7월 16일
Could you give a full discription on the problem solving steps that your performed? Thank you!
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!