Does "sortrows" not work with a semicolon?
2 ビュー (過去 30 日間)
古いコメントを表示
Could someone clarify this issue I am having?
I tried to sort the rows of a matrix by the first column (in descending order)...
sortrows(P, -1) % works fine
But, for some reason:
sortrows(P, -1); % does not work!
Is this a known issue?
D Howard
0 件のコメント
採用された回答
Walter Roberson
2012 年 2 月 21 日
Remember, sortrows(P,-1); would sort the rows and then would throw away the results because you did not write them to a variable.
その他の回答 (1 件)
Kevin Holst
2012 年 2 月 21 日
Works fine for me. I did this:
a = magic(5);
b = sortrows(a,-1);
When you say, does not work, do you mean it gives you an error, or it does not sort properly?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!