Search code examples
excelmatlabcsvxlsread

Does the xlsread function in MATLAB require Excel?


I have two computers with the same MATLAB code and same Excel file (.csv format). The code only works on the machine that has Excel. I can't think of any other differences.

Does a computer need Excel for xlsread to work? The error I'm getting is an unrecognized format.

If this is the case, are there any easy workarounds without getting Excel?

EDIT: It appears that Excel is not needed. Maybe the issue is that the file is a .csv? It is a format error after all. I just can't imagine why a file of the same format worked on my other computer.

SOLVED: The .csv file was the problem. For reading .csv files, the importdata() function of matlab proved to be really versatile.


Solution

  • xlsread(filename,sheet,xlRange,'basic') will work without Excel installed on your machine.

    Other additional arguments will require Excel to be installed.

    Matlab can import character separated files natively though.