Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: no_repeated_digits_in_row
Date: Mon, 30 Aug 2010 08:24:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <i5fpr7$scg$1@fred.mathworks.com>
References: <i5fjq1$spb$1@fred.mathworks.com> <i5flva$i3m$1@fred.mathworks.com> <i5fmv9$ku7$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1283156647 29072 172.30.248.37 (30 Aug 2010 08:24:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 30 Aug 2010 08:24:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1886545
Xref: news.mathworks.com comp.soft-sys.matlab:666059

"Kate " <chino_tones@hotmail.com> wrote in message <i5fmv9$ku7$1@fred.mathworks.com>...
> Oleg,,
> How can I make this more robust? 
> 
> Such as for the following matrix:
> 
> A=[  3     2     3     3     2
>      3     2     3     3     3
>      3     3     1     1     1
>      3     3     1     1     2
>      3     3     1     1     3
>      3     3     1     2     1
>      3     3     1     2     2
>      3     3     1     2     3
>      1     2     3     4     5]
> 
> where ideal answer I would like to get is:
> 
> Ideal_Answer =[ 1  2  3  4  5 ]
> 
> With your code , I got , which as we can see is NOT ideal since rows with repeated values still exist:
> 
> Incorrect_answer = [3     2     3     3     3
>                               3     3     1     2     3
>                               1     2     3     4     5 ]
> 
> 
> thanks for the help.
> 
> kate

Change:
A = A(~any(freq == 2,2),:)
to:
A = A(~any(freq >= 2,2),:)

Oleg