Sort a matrix based on unique values
Afficher commentaires plus anciens
Hi,
Lets assume I have matrix M:

And I want to fill in matrix O:

I want to sort the final matrix based on the first row in matrix M and O. If I just fill in matrix O without sorting, I get this result:

This is wrong, because colum 3 should be NaN while column 4 should have the values from matrix O, because there is a "match" between the first rows (1004 and 1004).
I hope it was clear. Thanks
Réponse acceptée
Plus de réponses (0)
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!