Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Getting indexes of rows of matrix with more than n repetitions
Date: Wed, 6 Jan 2010 07:19:06 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <hi1dha$8mu$1@fred.mathworks.com>
References: <hhudae$4p$1@fred.mathworks.com> <hhuths$led$1@fred.mathworks.com> <hi023t$mtq$1@fred.mathworks.com> <hi0kgl$c56$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 1262762346 8926 172.30.248.35 (6 Jan 2010 07:19:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 6 Jan 2010 07:19:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:596783

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hi0kgl$c56$1@fred.mathworks.com>...
unning the method posted by us:
>   v2 = v(:,1) + 17 * v(:, 2);
> Then UNIQUE does not need the 'rows' flag and sorting might become faster.
> There is some potential in us' method: UNIQUE and ISMEMBER sort their input (and perhaps HISTC does also?). So it would be faster to sort the large array once and operate with the sorted index.

Jan,

HISCT is a dichotomy insertion method, which would be O(N*log(M)) in complexity where N and M are respectively the number of data and edges. So HISTC is faster than SORT when M<N in theory.
 
A better way for large array is ACCUMARRAY, see a thread here: http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/252639

Bruno