Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Count occurences by row
Date: Fri, 16 Jul 2010 19:18:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 9
Message-ID: <i1qb9c$oo4$1@fred.mathworks.com>
References: <i1q7ng$78g$1@fred.mathworks.com> <i1q9c0$li7$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279307884 25348 172.30.248.35 (16 Jul 2010 19:18:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Jul 2010 19:18:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:653770

Another solution:

a=[1 2 2;
2 3 3;
1 4 5];

sum(accumarray([mod((0:numel(a)-1)',size(a,1))+1 a(:)],1)>0)

Bruno