Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: find same value
Date: Thu, 9 Jun 2011 18:56:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 42
Message-ID: <isr504$ps7$1@newscl01ah.mathworks.com>
References: <isp2hq$ot$1@newscl01ah.mathworks.com> <3bc3d24c-d131-41bd-a180-32f439c2f03f@l18g2000yql.googlegroups.com> <isqrpo$r95$1@newscl01ah.mathworks.com> <isqtkd$3em$1@newscl01ah.mathworks.com> <isr361$k4s$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1307645764 26503 172.30.248.47 (9 Jun 2011 18:56:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Jun 2011 18:56:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:731118

"pink" wrote in message <isr361$k4s$1@newscl01ah.mathworks.com>...
> "Roger Stafford" wrote in message <isqtkd$3em$1@newscl01ah.mathworks.com>...
> > "pink" wrote in message <isqrpo$r95$1@newscl01ah.mathworks.com>...
> > > I just wanted to check the data (matrix) if the (:, 1) there is or is not the same value, if it will it will display the message "warndlg"
> > - - - - - - - -
> >   You didn't answer the question I asked about what you meant by "same".  Here are tests for either meaning:
> > 
> > 1.  If "same" refers only to contiguous elements:
> > 
> >  t = any(diff(A(:,1)==0));
> > 
> > 2.  If "same" refers to any pair of elements within the vector:
> > 
> >  t = any(diff(sort(A(:,1))==0));
> > 
> > Roger Stafford
> soory roger, not work
> I just wanted to check first column element
> A=[1 34;
>      2 33;
>      2 45;
>      3 32;
>      4 65;
>      4 99;
>      5 11;
>      1 33;
>      6 22]
> on A (:, 1) there are 3 number the same, then A = 1
> A=[1 34;
>      2 33;
>      3 45;
>      4 32;
>      5 65;
>      6 99;
>      7 11;
>      8 33;
>      9 22]
> on A (:, 1) there is not the same numbers, then A = 0
- - - - - - - -
  I cannot help you any further if you continue to avoid answering my question.  It's a reasonable question to ask.

Roger Stafford