how to sort a cell array in descending order ?
1 次查看(过去 30 天)
显示 更早的评论
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!