how to find max of a column and run it in a loop

1 visualización (últimos 30 días)
raqib Iqbal
raqib Iqbal el 3 de Jul. de 2020
Editada: madhan ravi el 3 de Jul. de 2020
device=[1 2 3 4 5 6 7 8 9 10]
block=[1 10;2 11;3 7;4 13;5 14]
new=block(block(:,1) == max(block(:,1)),:)
how to run this max value finding in a loop and display with adding elemnt from device array? like after first find output will be 1 5 14 and last output will be 5 3 7.
  5 comentarios
raqib Iqbal
raqib Iqbal el 3 de Jul. de 2020
block=[1 10;2 11;3 7;4 13;5 14] row 3 and min c2 value
raqib Iqbal
raqib Iqbal el 3 de Jul. de 2020
block=[1 10;2 11;3 7;4 13;5 14]
sir you just tell me how to display max of C2 value to min of C2 value (dscending order) with their corresponding c1 value

Iniciar sesión para comentar.

Respuesta aceptada

madhan ravi
madhan ravi el 3 de Jul. de 2020
Editada: madhan ravi el 3 de Jul. de 2020
C = sortrows(block, 2, 'descend') %?

Más respuestas (0)

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