필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
sneha sharma
sneha sharma 2015년 12월 9일
편집: Stephen23 2015년 12월 10일
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
sneha sharma
sneha sharma 2015년 12월 10일
it is simply the type...it could be anything..

댓글을 달려면 로그인하십시오.

답변 (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에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by