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$>
References: <isp2hq$ot$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1307582045 10661 (9 Jun 2011 01:14:05 GMT)
NNTP-Posting-Date: Thu, 9 Jun 2011 01:14:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:730948

"pink" wrote in message <isp2hq$ot$>...
> 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