sort cell array in descending order based on 2nd column
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
jahanzaib ahmad
el 26 de Mzo. de 2019
Comentada: Adam Danz
el 26 de Mzo. de 2019
i have cell array and want to sort it based on 2nd column .
i have tried this
[~,idx] = sort([AA{:,2}]);
idx([1:2:end,2:2:end]) = idx;
B = AA(idx,:);
but 2nd column in not in descending order .
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
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!