The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: how to find unique rows and calculate the average.
Replies: 9   Last Post: Apr 12, 2013 6:31 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Hitch

Posts: 9
Registered: 4/10/13
Re: how to find unique rows and calculate the average.
Posted: Apr 11, 2013 6:50 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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.

dpb <> wrote in message <kk58cv$2k3$>...
> 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...)
> --

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.