I open a file with xlsread with windows version of MATLAB, but I can't open the same file with the linux 64 bit version

5 ビュー (過去 30 日間)
Paolo 2011 年 9 月 20 日
Dear sir/madame I wrote a.m file that correctly works with a windows version of MATLAB. But when I used this script in LINUX, the program gave the error:
Warning: XLSREAD has limited import functionality on in basic mode. Refer to HELP XLSREAD for more information. > In xlsread at 168 Error using xlsread (line 232) XLSREAD unable to read sheet INPUT. File contains unexpected record length. Try saving as Excel 98.
I tried to save a file as Excel 95, because I didn't find the Excel 98 option. I also tried to wrote the commands: xlsread('MD_Loss1.xls','INPUT','basic') or xlsread('MD_Loss1.xls') but the file.m gave the error message. How can I resolve the problem? Best regards Paolo Ubezio

回答 (1 件)

Ora Zyto
Ora Zyto 2011 年 11 月 1 日
The xlsread command behaves differently on LINUX and Windows, since its full functionality relies on COM communication with Excel, which is only available on Windows OS.
Per the MATLAB documentation, in basic mode, the xlsread function:
  • Only reads XLS files.
  • Imports the entire active range of the worksheet.
  • Requires a string to specify the sheet, and the sheet name is case sensitive.
  • Does not support function handle inputs.
To test the portability of your script file.m, you can force xlsread to function in basic mode on Windows as follows: xlsread('MD_Loss1.xls',sheet,'','basic') You could use this setup to troubleshoot any incompatibilities of your Excel file with the basic mode of xlsread.



Community Treasure Hunt

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

Start Hunting!

Translated by