Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: find same value
Date: Thu, 9 Jun 2011 01:14:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <isp6ot$ad5$1@newscl01ah.mathworks.com>
References: <isp2hq$ot$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1307582045 10661 172.30.248.38 (9 Jun 2011 01:14:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Jun 2011 01:14:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:730948

"pink" wrote in message <isp2hq$ot$1@newscl01ah.mathworks.com>...
> how do I find the same value in the matrix a(:,1)
- - - - - - - -
  When you say "same", do you mean contiguous elements that are equal or do you mean any two elements that are equal?  If by "find" you mean you want to locate the repeating elements, which of their indices do you want?

  This will give the index of the second of any equal contiguous pair:

 f = find(diff(A(:,1))==0)+1;

Roger Stafford