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.
According to this page
If your system has Excel® for Windows® installed, including the COM server (part of the typical installation of Excel):
All MATLAB® import options support XLS, XLSX, XLSB, XLSM, XLTM, and XLTX formats.
...
If your system does not have Excel for Windows installed, or the COM server is not available:
All MATLAB import options read XLS, XLSX, XLSM, XLTM, and XLTX files.
However, if you are just trying to import a comma delimited ASCII file, then xlsread is way overkill and super slow. If your data is purely numeric, use csvread or dlmread. If your data is mixed, then use textscan instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With