xlsread on Mac not working

3 次查看(过去 30 天)
Dustyn Roberts
Dustyn Roberts 2013-1-14
I use xlsread all the time on Windows, but it's not working on my Mac. Here is the line of code that doesn't work:
xlsread('/Users/dustyn/Dropbox/NYU-Poly/research/001 Robotic Metabolism/2 DOF Arm/experiment/Simple Arm Experiments.xls');
no matter what I do - change the direction of slashes, make it a .xlsx file or not, put a leading / or not - i get this error:
Error using xlsread (line 129) XLSREAD unable to open file '/Users/dustyn/Dropbox/NYU-Poly/research/001 Robotic Metabolism/2 DOF Arm/experiment/Simple Arm Experiments.xls'. File '/Users/dustyn/Dropbox/NYU-Poly/research/001 Robotic Metabolism/2 DOF Arm/experiment/Simple Arm Experiments.xls' not found.
Any thoughts? I'm on Mac OS X 10.7.5 and MATLAB R2012a
  2 个评论
Walter Roberson
Walter Roberson 2013-1-14
If you try
exist('/Users/dustyn/Dropbox/NYU-Poly/research/001 Robotic Metabolism/2 DOF Arm/experiment/Simple Arm Experiments.xls')
then what does MATLAB say?
Also, if you
!ls '/Users/dustyn/Dropbox/NYU-Poly/research/001 Robotic Metabolism/2 DOF Arm/experiment/Simple Arm Experiments.xls'
Please check carefully that the case matches -- e.g., should the directory be Reseearch with a capital?
Theo Olsthoorn
Theo Olsthoorn 2013-10-11
Just save your excel file as excel 5.0/95 then it will work

请先登录,再进行评论。

回答(2 个)

Theo Olsthoorn
Theo Olsthoorn 2014-11-11
It starts being a shame on the Mathworks, even in version 2014 not being able to read modern xls files properly on OSX, because the ability to read xls files is such an important feature. I use it every day, but always have to revert to xls version 5.0/95, which is 20 years old !

Shashank Prasanna
Shashank Prasanna 2013-1-14
XLSREAD is designed to read Excel files only on windows and will not work on Macs. By default XLSREAD will revert to CSVREAD on all Macs and on Windows systems that don't have Excel installed. This is because XLSREAD uses the ActiveX COM interface to communicate with Excel and this is windows specific. Please see the following link for more information:
The only work around currently is to make sure that the file in questions be saved as a CSV file if possible, this can be done through Excel via Save As.
  8 个评论
Walter Roberson
Walter Roberson 2013-2-2
At the command line please try
which -all xlsread
I suspect you might have your own xlsread.m in the path.
Walter Roberson
Walter Roberson 2013-2-2
Above you show,
>> Simple Arm Experiments Summary
How is that coming about? It has the appearance that you typed that in as a command, which does not make sense to me.
When you talk about "same error" are you referring to undefined function Simple, or are you referring to the original question with the unable to open file?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by