how to sort a cell array in descending order ?

1 visualización (últimos 30 días)
Meme
Meme el 9 de Abr. de 2014
Editada: Joseph Cheng el 9 de Abr. de 2014
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

Respuestas (1)

Joseph Cheng
Joseph Cheng el 9 de Abr. de 2014
Editada: Joseph Cheng el 9 de Abr. de 2014
you can use the function sortrows() and then reverse the matrix rank(end:-1:1,:).

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by