how to sort a cell array in descending order ?
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160551/image.png)
how to sort a cell array in descending order ? I have this code for cell array
ra=0;
rank=cell(50,1);
for i=1:50
for j=1:50;
if users{j,i}~='-';
ra=ra+1;
end
end
rank{i,1}=ra;
ra=0;
end
0 件のコメント
回答 (1 件)
Joseph Cheng
2014 年 4 月 9 日
編集済み: Joseph Cheng
2014 年 4 月 9 日
you can use the function sortrows() and then reverse the matrix rank(end:-1:1,:).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!