Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating a new vector based on unique entries
Date: Thu, 14 May 2009 20:32:02 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 9
Message-ID: <guhv42$7qv$1@fred.mathworks.com>
References: <guh7ap$s7n$1@fred.mathworks.com> <guhrld$m89$1@fred.mathworks.com> <1edcb1d3-04a7-4c56-bd32-dde07e68c7a8@n7g2000prc.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1242333122 8031 172.30.248.38 (14 May 2009 20:32:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 14 May 2009 20:32:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:540041


Siyi 
> us, I realized that accumarray(...,@mean) can be slower than using
> r = accumarray(ix,n)./accumarray(ix,1);

that certainly is/may be correct in this particular case...
however, i used the (more) generic syntax for educational purposes - eg, what if the OP needs the @sum or something else being applied to the clusters...

just a thought
us