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.