I have a matrix of 100 rows and 2 columns. How to sort the first column of the matrix and write the corresponding second column elements. Please help me. Its Urgent.Thanks in Advance

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2015년 5월 27일

0 개 추천

A = rand(100,2); % your matrix
[~,ii] = sort(A(:,1));
out = A(ii,:);

댓글 수: 1

Jes
Jes 2015년 5월 27일
Thanks a lot. It works. Could you please explain me once . Thanks

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

추가 답변 (1개)

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품

질문:

Jes
2015년 5월 27일

댓글:

2015년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by