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

1 次查看(过去 30 天)
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 个评论

请先登录,再进行评论。

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by