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.

Replies: 5   Last Post: Jan 21, 2013 4:39 PM

 Messages: [ Previous | Next ]
 Derek Goring Posts: 3,922 Registered: 12/7/04
Posted: Jan 21, 2013 2:17 PM

On Tuesday, January 22, 2013 8:04:05 AM UTC+13, dpb wrote:
> 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
>
>
>
> --

My interpretation of what he wants is the columns corresponding to unique headings, whence:
indx=sort(indx); % needed because unique sorts the data
y=data(:,indx);

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