help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficient unique/sum column(s)


From: Andrei Bobrov
Subject: Re: Efficient unique/sum column(s)
Date: Wed, 5 Feb 2014 01:38:47 -0800 (PST)

z = [x,y];
[a,b,c1] = unique(z,'rows','first');
[~,ii] = sort(b);
[~,iii] = sort(ii);
out = [a(ii,:), accumarray(iii(c1),c)];



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Efficient-unique-sum-column-s-tp4661633p4661638.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]