From: Jason on
I am trying to read excel file which contains both string and numbers.

it works fine when i tried to read only numbers.

but whenever I tried to read column which contains text strings, it is not working properly.

I used following command.

var_list=xlsread('some.xlsx', 'sheet1', 'B1:B200');

it returns empty [].

I wander if there is certain way to specify data type that you are about to read in excel file.
what should i do?
From: Steven Lord on

"Jason " <dhcho(a)icu.ac.kr> wrote in message
news:hm3i2t$p4v$1(a)fred.mathworks.com...
>I am trying to read excel file which contains both string and numbers.
>
> it works fine when i tried to read only numbers.
>
> but whenever I tried to read column which contains text strings, it is not
> working properly.
>
> I used following command.
>
> var_list=xlsread('some.xlsx', 'sheet1', 'B1:B200');
>
> it returns empty [].
>
> I wander if there is certain way to specify data type that you are about
> to read in excel file.
> what should i do?

Since the spreadsheet contains mixed numeric/text data (and particularly if
cells B1:B200 contain nonnumeric data) then you should use the two- or
three-output syntax for XLSREAD.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: us on
"Jason "
> var_list=xlsread('some.xlsx', 'sheet1', 'B1:B200');
> it returns empty [].
>
> I wander if there is certain way to specify data type that you are about to read in excel file.
> what should i do?

a hint:

% carefully look at the output arguments number two and three in
help xlsread;

us
From: Jason on
"Steven Lord" <slord(a)mathworks.com> wrote in message <hm3ku5$3q8$1(a)fred.mathworks.com>...
>
> "Jason " <dhcho(a)icu.ac.kr> wrote in message
> news:hm3i2t$p4v$1(a)fred.mathworks.com...
> >I am trying to read excel file which contains both string and numbers.
> >
> > it works fine when i tried to read only numbers.
> >
> > but whenever I tried to read column which contains text strings, it is not
> > working properly.
> >
> > I used following command.
> >
> > var_list=xlsread('some.xlsx', 'sheet1', 'B1:B200');
> >
> > it returns empty [].
> >
> > I wander if there is certain way to specify data type that you are about
> > to read in excel file.
> > what should i do?
>
> Since the spreadsheet contains mixed numeric/text data (and particularly if
> cells B1:B200 contain nonnumeric data) then you should use the two- or
> three-output syntax for XLSREAD.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>


Thanks, it helped me a lot.

[numerics, strings]=xslread('excel.xlsx', 'sheet1', 'B1:B200');

it works. ^^*