Path: news.mathworks.com!not-for-mail
From: "vagrom Jiang" <vagrom@mytum.de>
Newsgroups: comp.soft-sys.matlab
Subject: how to sum elements with identical subscript
Date: Sat, 29 Nov 2008 02:32:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <ggq9j1$ssm$1@fred.mathworks.com>
Reply-To: "vagrom Jiang" <vagrom@mytum.de>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227925921 29590 172.30.248.37 (29 Nov 2008 02:32:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Nov 2008 02:32:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1621582
Xref: news.mathworks.com comp.soft-sys.matlab:503735


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.