Simple question regarding sorting
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, If I have two column matrixes of size Nx1 and Mx1 and I want to marge them together to make a Yx1 Column, but sorted in order how would I do this? I would not want a repeate of a number also.
0 Kommentare
Akzeptierte Antwort
Wayne King
am 28 Jun. 2012
Bearbeitet: Wayne King
am 28 Jun. 2012
X = randi(30,100,1);
Y = randi(30,50,1);
Z = unique([X ; Y]);
The result from unique() is sorted.
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!