To order min to max value for matrix's row

4 visualizaciones (últimos 30 días)
sermet
sermet el 7 de Mayo de 2014
Respondida: José-Luis el 7 de Mayo de 2014
a=[0.412 0.322 0.300 0.112;0.222 0.05 0.350 0.555]
% I wanna order row's value min to max. like that;
a=[0.112 0.300 0.322 0.412;0.05 0.112 0.222 0.350 0.555]

Respuesta aceptada

José-Luis
José-Luis el 7 de Mayo de 2014
sortrows(sort(a,2))

Más respuestas (2)

Andrei Bobrov
Andrei Bobrov el 7 de Mayo de 2014
  1 comentario
sermet
sermet el 7 de Mayo de 2014
it works only one row, I need all rows need to be order

Iniciar sesión para comentar.


Youssef  Khmou
Youssef Khmou el 7 de Mayo de 2014
Try :
a=sort(a,'ascend');

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by