Minimum of unique values
Ältere Kommentare anzeigen
I am trying to find the minimum of vector y=[ 1 2 4 3 9 7] which corresponds to vector x= [100 100 200 200 300 300] so that the result is z=[1 3 7]
what I need is the minimum of each unique x value.
Akzeptierte Antwort
Weitere Antworten (2)
Andrei Bobrov
am 9 Mär. 2016
[~,~,c] = unique(x);
z = accumarray(c(:),y(:),[],@min);
Blotter678
am 9 Mär. 2016
0 Stimmen
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!