Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matrix problem with columns
Date: Sun, 13 May 2012 18:13:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <jootjk$efi$1@newscl01ah.mathworks.com>
References: <joorjs$70s$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1336932788 14834 172.30.248.38 (13 May 2012 18:13:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 13 May 2012 18:13:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2386204
Xref: news.mathworks.com comp.soft-sys.matlab:767708

"Konst " <konstance1@hotmail.com> wrote in message <joorjs$70s$1@newscl01ah.mathworks.com>...
> I have a matrix(i,2). I want to read the matrix and while the elements of the first column are the same(They are already sorted), compute the mean of the elements in the second row.When the values in column 1 change, do the same but without considering the previous elements of column 2 that have already been used. eg
> matrix=1   3
>            1   2
>            2   1.....
> ans=2.5    1.....
> Any ideas? Thanks for your time!
>            

help accumarray
or see http://blogs.mathworks.com/loren/2008/02/20/under-appreciated-accumarray/