Search All of the Math Forum:

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

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

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

 Messages: [ Previous | Next ]
 dpb Posts: 9,850 Registered: 6/7/07
Re: Simple Problem to Ask
Posted: Jan 21, 2013 2:04 PM

On 1/21/2013 11:39 AM, Mark Gul wrote:
> Dear Friends
>
> I Have a simple problem to ask you.
>

>
> 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

--

Date Subject Author
1/21/13 Khalid Iqbal
1/21/13 Roger Stafford
1/21/13 dpb
1/21/13 Derek Goring
1/21/13 dpb
1/21/13 dpb