a command for changing the place of columns in a matrix directly
2 ビュー (過去 30 日間)
古いコメントを表示
Hi all
I have a matrix m-by-n and I want to change the place of columns with an espiciall command in matlab. How can I do this . for Example:
a=[10 20; 20 40; 10 30] chaanged to b=[20 10; 40 20; 30 10]
Thanks for your guidance cheers
0 件のコメント
採用された回答
Andrew Newell
2011 年 12 月 29 日
You can do this with the matrix indices. For the example you give,
b = a(:,[2 1]);
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!