Filter löschen
Filter löschen

how to sort an array based on a specific column and display it in another array

1 Ansicht (letzte 30 Tage)
i have attached below an array named sector1 and want to sort the array based on the last column and display the type of the first element (minimum) after sorting as 'cm' and others as 'ch' as other column in same array
  3 Kommentare

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Stephen23
Stephen23 am 10 Dez. 2015
Bearbeitet: Stephen23 am 10 Dez. 2015
[~,idx] = sort(sector1(:,end));
and use the index variable idx to sort whichever other variables you wish to.

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by