フィルターのクリア

Problem to import data from Excel to Matlab

5 ビュー (過去 30 日間)
Maddalena Mandarà
Maddalena Mandarà 2011 年 6 月 10 日
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
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.
Maddalena Mandarà
Maddalena Mandarà 2011 年 6 月 12 日
Sorry, I've type Excel 2011 instead of Excel 2010. Anyway I tried to open my file on Excel 2008 on Macintosh system on an other platform, and there wasn't problem.
Unfortunately, my xls file contains numeric and text data, then I can not save it as a binary file and import it as a text file.
I've just try to import a selected range of my xls file, then I've type the command: [num,text]=xlsread('myxlsfile.xls','a1:bv5000') but the warning on 'unrecognized string header' appears. I've use this range because Matlab detective the problem at the row 4813 of the "text" matrix. Then
I've try to type the command: [num,text]=xlsread('myxlsfile.xls','a1:bv50') where the range don't include the row 4813.
The warning message persist because Matbal tell me that "Range cannot be used in 'basic' mode. The entire sheet will be loaded. ' Thank you for your help! Maddalena

サインインしてコメントする。

採用された回答

Kaustubha Govind
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 件のコメント
Maddalena Mandarà
Maddalena Mandarà 2011 年 7 月 15 日
I solved the problem with the help of MathWorks Technical Support. I used an Excel's vitualized version and this was the gap. Now, I use an Excel's application version and xlsread work very well.
Thank you to all
Maddalena
Kokalz
Kokalz 2012 年 7 月 16 日
Could you give a full discription on the problem solving steps that your performed? Thank you!

サインインしてコメントする。

その他の回答 (2 件)

Guido Travaglini
Guido Travaglini 2011 年 6 月 12 日
Make sure the path shown in the "Current Folder" window is the same where your XLS file resides.
  1 件のコメント
Maddalena Mandarà
Maddalena Mandarà 2011 年 6 月 12 日
Yes, the Current Folder windoew is the same where my xls file resides. Anyway I've type the path in the argument of xlsread function.
Thank you!
Maddalena

サインインしてコメントする。


Kokalz
Kokalz 2012 年 7 月 16 日
Could you give a full discription on the problem solving steps that your performed? Thank you!
  2 件のコメント
Maddalena Mandarà
Maddalena Mandarà 2012 年 7 月 16 日
Sure! I simply installed Excel using the CD, and not by downloading it from its website. If you need other informations, let me know.
Kokalz
Kokalz 2012 年 7 月 16 日
How did you find out you were using the virtualized version of Excel?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by