Sorting matrix

4 ビュー (過去 30 日間)
FIR
FIR 2012 年 2 月 18 日
編集済み: Cedric 2013 年 10 月 15 日
I have amatrix
A=[1 2 13;
10 1 2;
8 14 3]
I want to sort 2nd column,so the corresponding values must also change
as
A=[10 1 2;
1 2 13;
8 14 3]

採用された回答

Wayne King
Wayne King 2012 年 2 月 18 日
[~,indices] = sort(A(:,2));
A = A(indices,:);
  1 件のコメント
FIR
FIR 2012 年 2 月 18 日
Thanks Wayne can u answer the question in plz
http://www.mathworks.in/matlabcentral/answers/29490-error-using-cell2mat

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by