Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: Simple Problem to Ask
Replies: 5   Last Post: Jan 21, 2013 4:39 PM

Advanced Search

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

Posts: 8,288
Registered: 6/7/07
Re: Simple Problem to Ask
Posted: Jan 21, 2013 2:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/21/2013 11:39 AM, Mark Gul wrote:
> Dear Friends
>
> I Have a simple problem to ask you.
>
> Headings={'A','C','D','E','AC','AD','AE','AC', ...

'CD','CE','AD','CD','DE','AE','CE','DE'}
>
> Data =
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 0 1 1 0 1 1 0 1 1 0 0 0 0
> 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0
> 1 0 1 1 0 1 1 0 0 0 1 0 1 1 0 1
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
> For each Heading, one column in sequence is represented.
> Now, the problem is that I want to get unique headings as well as
> according to unique headings, the same columns of Data in the above
> dataset.
>
> If anyone knows some useful way, Please tell me, I will be highly thankful.


As Roger says, it's certainly precisely clear what you're asking as the
headings as given seem to be unique already (at least in the sense of no
duplicates).

I'm _guessing_ that perhaps you're looking for something that let's you
find the column index/indices of a set of one or more heading values and
the appropriate data associated w/ same. If so, then sotoo

ix=findstr(Headings,'A'); % all locations w/ an 'A' as part of title
y=data(:,ix); % the corresponding data columns

--




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.