what is the result?

2 ビュー (過去 30 日間)
diadalina
diadalina 2017 年 10 月 24 日
編集済み: KSSV 2017 年 10 月 24 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by