How to read numbers spreadsheets from Mac using Matlab

Hi
I am using the xlsread command to read numbers spreadsheets in Matlab but I get the error that cannot find the file. The file is in the folder but cannot find it. Why? I don't get any error with the xlsread command. Can Matlab see number spreadsheets? It has been saved as the one the Numbers app of Mac exports

4 commentaires

I used the csvread command and the file.numbers extension and I get the error
Error using dlmread (line 147)
HeaderColumns must be integer-valued.
Error in csvread (line 48)
m=dlmread(filename, ',', r, c);
Error in ogden (line 2)
SheetA = csvread('instron.numbers',1,'M2:M1027');
>>
csvread never supported named ranges. csvread is not just another name for xlsread.
In any case, I don't think there's any function in matlab that can read numbers files, which are neither text files nor excel files. If the file has been exported as an excel file then yes it could be read with xlsread or better readtable or readmatrix but the file is no longer a numbers file.
Of course, csvread, dlmread and co. have never been able to read excel files. Only text files.
If the file is xls or xlsx then unless Windows with Excel is being used, it may be necessary to use readtable.

Connectez-vous pour commenter.

Réponses (2)

Jyotsna Talluri
Jyotsna Talluri le 4 Nov 2019

0 votes

'xlsread' is not recommended in the latest versions .Instead try using 'readtable'
Cris LaPierre
Cris LaPierre le 7 Jan 2021

0 votes

MATLAB does not appear to be able to read these files directly. The recommended workaround is to export the file as a *.xlsx or *.csv file, then import using readtable. Other methods for importing can be found here.

Community Treasure Hunt

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

Start Hunting!

Translated by