how sort just nonzero values?
Mostrar comentarios más antiguos
how can sort values except zero values i.e i want to sort just non zero values in c. how do that. c=[8 4 5 1 0 0 0 ];
thanks
Respuesta aceptada
Más respuestas (1)
Jonathan Sullivan
el 12 de Mzo. de 2012
c=[8 0 5 0 1 0 4];
c_new = sort(c,'descend')
1 comentario
huda nawaf
el 12 de Mzo. de 2012
Categorías
Más información sobre Shifting and Sorting Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!