Simple question regarding sorting
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Honglei Chen
le 28 Juin 2012
x = [1 3 5 7 9]'
y = [1 2 3 4 5]'
unique(sort([x;y]))
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!