Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to sum elements with identical subscript
Date: Sat, 29 Nov 2008 02:40:18 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 20
Message-ID: <ggqa2i$443$1@fred.mathworks.com>
References: <ggq9j1$ssm$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227926418 4227 172.30.248.35 (29 Nov 2008 02:40:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Nov 2008 02:40:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:503736


"vagrom Jiang" <vagrom@mytum.de> wrote in message <ggq9j1$ssm$1@fred.mathworks.com>...
> here is an example,  A is N*2 matrix,
> A = [2  20;
>         5 10;
>         5 30;
>         7 10;
>         .......];
> expected result is A= [2  20;
>                                 5  40;
>                                 7  10;
>                                 .........];
> how to  solve this problem without any  Loop to implement, since N could be very large, e.g 10e6.
> 

Consolidator does this. Find it here:

http://www.mathworks.com/matlabcentral/fileexchange/8354

HTH,
John