MATLAB: Why reading .xls file using xlsread returns empty variables

arraycell arraysdata importexcelimporting excel datatablexlsread

Hello
I have some data in a .xls file. the file content is four colunms. the first row is a header then all others are numbers.
I tried to simply use
[ndata, text, alldata] = xlsread(filename)
but it does not return anything
ndata =
[]
text =
0×0 empty cell array
alldata =
1×1 cell array
{[NaN]}
How can I solve this problem?
Thanks!

Best Answer

The problem is the data is not in the first sheet of the .xls file.
I needed to sort the xls sheets before using
[ndata, text, alldata] = xlsread(filename)