From: Thomas on
Hi,

I'm running Matlab R2007a on Mac OS X 10.6.4 and am having some problems with the xlsread function not behaving as expected.

I have a 360x20 .xls file, where some columns contain text data, and others contain numerical data. When I import this to my workspace using xlsread, only the first 104 rows are imported. The syntax I am using is as follows:

>> data = xlsread('FILE.xls')

The Excel file has a "header" row, and below that, the data. It is saved as an Excel '04 .xls file.


Is there any way to have Matlab import all of the data file, or will I have to buy a Windows copy of Matlab and boot into Windows every time, to enable the COM server features that are lacking in the Mac version of Matlab?


Thanks for the help!
From: Thomas on
Can anyone help with this? It is quite urgent.


Thanks.
From: Walter Roberson on
Thomas wrote:

> I'm running Matlab R2007a on Mac OS X 10.6.4 and am having some problems
> with the xlsread function not behaving as expected.
>
> I have a 360x20 .xls file, where some columns contain text data, and
> others contain numerical data. When I import this to my workspace using
> xlsread, only the first 104 rows are imported.

Is there something obviously different about the 105'th row?

The syntax I am using is
> as follows:
>
>>> data = xlsread('FILE.xls')
>
> The Excel file has a "header" row, and below that, the data. It is saved
> as an Excel '04 .xls file.
>
>
> Is there any way to have Matlab import all of the data file, or will I
> have to buy a Windows copy of Matlab and boot into Windows every time,
> to enable the COM server features that are lacking in the Mac version of
> Matlab?

Your existing Matlab license entitles you to run under any OS; you would
not need to buy another copy.

If you were to say more about your file format and about how the 105th
row differs from the previous ones, then we may be able to direct you to
other routines, such as textscan() or dlmread()
From: Thomas on
Walter Roberson <roberson(a)hushmail.com> wrote in message <valZn.6827$cO.1142(a)newsfe09.iad>...
> Thomas wrote:
>
> > I'm running Matlab R2007a on Mac OS X 10.6.4 and am having some problems
> > with the xlsread function not behaving as expected.
> >
> > I have a 360x20 .xls file, where some columns contain text data, and
> > others contain numerical data. When I import this to my workspace using
> > xlsread, only the first 104 rows are imported.
>
> Is there something obviously different about the 105'th row?
>
> The syntax I am using is
> > as follows:
> >
> >>> data = xlsread('FILE.xls')
> >
> > The Excel file has a "header" row, and below that, the data. It is saved
> > as an Excel '04 .xls file.
> >
> >
> > Is there any way to have Matlab import all of the data file, or will I
> > have to buy a Windows copy of Matlab and boot into Windows every time,
> > to enable the COM server features that are lacking in the Mac version of
> > Matlab?
>
> Your existing Matlab license entitles you to run under any OS; you would
> not need to buy another copy.
>
> If you were to say more about your file format and about how the 105th
> row differs from the previous ones, then we may be able to direct you to
> other routines, such as textscan() or dlmread()

Hi Walter,

Thanks for the reply.

The 105th row does not differ from any other row. The only row in the data file that is different is the first row, and that is a header row. Basically the Excel file is created by a data-logging programme and logs one set of data to each row, after creating a header row at the start of the document. As long as it is less than 104 lines, Matlab handles it fine.

The columns are a mix of text and numbers (some columns are only text, some are only numbers, with the exception of the header row, none are mixed). Matlab correctly converts any text cell to "NaN" and leaves the numbers intact.

I will look into the other functions you mentioned.
From: Walter Roberson on
Thomas wrote:

> The 105th row does not differ from any other row. The only row in the
> data file that is different is the first row, and that is a header row.
> Basically the Excel file is created by a data-logging programme and logs
> one set of data to each row, after creating a header row at the start of
> the document. As long as it is less than 104 lines, Matlab handles it fine.

That is odd.

Are some of the lines _quite_ long? I'm wondering now if you happen to
be reaching some magic file size after the 104th line?