Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: how to find unique rows and calculate the average.

$
0
0
dpb

I know this will work once I get the textscan line of code to work. If I am reading in a xls file with (txt,num,raw) which array should I put in the "fid" place? That is confusing me right now. After that is done everything should work fine.
Thanks again for all your help.
Alan




dpb <none@non.net> wrote in message <kk58cv$2k3$1@speranza.aioe.org>...
> On 4/10/2013 4:10 PM, Alan Hitch wrote:
> ...
>
> > Thanks for responding. I neglected to tell you that the data is a cell
> > array with different data types and textscan only works with double or
> > string. I read the data in using xlsread and was using the raw data. I
> > am relatively new to MatLab. How do I convert the cell array into a
> > double or string? I tried using cell2mat but the contents of my
> > cellarray are different data types.
>
> OK, it just dawned on me--your problem is trying to use RAW; use TEXT as
> the C{1} cell in my example and NUM as the C{2}. Since XLSREAD returns
> the numeric fields as a double array instead of cell, just dispense w/
> the curly brackets to dereference the cell contents and just use the
> subscripting expressions directly into NUM. (Of course, use whatever
> variable names you wish instead of the ML placeholders...)
>
> --

Viewing all articles
Browse latest Browse all 19628

Trending Articles