Effacer les filtres
Effacer les filtres

xlsread on mac os x!

1 vue (au cours des 30 derniers jours)
babak
babak le 9 Mai 2012
i've been used xlsread function on windows with out any problem, but on mac os x, it doesnt work, there is always an error in line 129, file adress in mac os is different from windows, on mac adress is indicated by / but on windows by \ . which of them should i use on mac? i tried both of them, it didnt work, what shoul i do?
  2 commentaires
Friedrich
Friedrich le 9 Mai 2012
can you post your line of code and the error message you get?
babak
babak le 10 Mai 2012
>> [a,pr,b]=xlsread('Users/babakloghmani/Desktop/2','2.xls','a1:a3868')
Error using xlsread (line 129)
XLSREAD unable to open file 'Users/babakloghmani/Desktop/2'.
File 'Users/babakloghmani/Desktop/2' not found.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 9 Mai 2012
The '/' is a valid path separator on both OS-X and MS Windows.
xlsread() on OS-X (and Linux) before R2012a is restricted to "basic mode" and cannot handle .xlsx files or extended .xls files.
  3 commentaires
Friedrich
Friedrich le 10 Mai 2012
You use xlsread wrong. The fist input is the path to the xls file:
xlsread('Users/babakloghmani/Desktop/2.xls','a1:a3868') or if the "2" is a folder on your desktop
xlsread('Users/babakloghmani/Desktop/2/2.xls','a1:a3868')
Walter Roberson
Walter Roberson le 10 Mai 2012
xlsread('/Users/babakloghmani/Desktop/2.xls','a1:a3868')
Notice the leading "/". Without that, operating systems will look relative to the current directory. The leading "/" tells the OS that the path is absolute.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by