X a matrix 2 × n containing the coordinates of n points of the plan. How to obtain a matrix where the points are ordered by ascending order of the x-axis?

 채택된 답변

KSSV
KSSV 2017년 10월 24일
편집: KSSV 2017년 10월 24일

2 개 추천

n = 100 ;
X = rand(2,n) ; % some random data
[val,idx] = sort(X(1,:),'ascend') ; % sort x values (first row) in ascending order
X = X(:,idx) ;

추가 답변 (0개)

카테고리

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

태그

질문:

2017년 10월 24일

편집:

2017년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by