Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sorting data
Date: Sat, 24 Mar 2012 04:59:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <jkjkb0$2n1$1@newscl01ah.mathworks.com>
References: <jkflbs$miv$1@newscl01ah.mathworks.com> <jkfn9t$t58$1@newscl01ah.mathworks.com> <jkj4bn$h79$1@newscl01ah.mathworks.com> <jkjbb2$7ei$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1332565152 2785 172.30.248.46 (24 Mar 2012 04:59:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 24 Mar 2012 04:59:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1879908
Xref: news.mathworks.com comp.soft-sys.matlab:762025

A is a matrix of frequency values. B = unique(A)
A =                                                                      B = 
[                                                                                  [
210.24     123.54     200.00                                                 123.54
240.65     240.65     230.35                                                 200.00
]                                                                                     210.65
                                                                                      230.35
                                                                                      240.65
                                                                                   ]
I need A to be the same size of B for each column. I need to get something like this:
ismember(B,A) =                                                                       
[                                                                                  
0     1     0                                                 
0     0     1                                                
0     0     0
0     0     1                                                 
0     1     0                                                
]  

i.e., 123.54 is the first value in B, so '1' is the first value in second column and 240.65 is the last value in B, so that is '1' as well. 

Hope this gives a better idea.

Thanks, 
Mathew