how to sort a cell array in descending order ?

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

답변 (1개)

Joseph Cheng
Joseph Cheng 2014년 4월 9일
편집: Joseph Cheng 2014년 4월 9일

0 개 추천

you can use the function sortrows() and then reverse the matrix rank(end:-1:1,:).

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

질문:

2014년 4월 9일

편집:

2014년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by