Find a Maximum in a Matrix
Mostrar comentarios más antiguos
Hello all,
I am trying to find a maximum in a 484x1800 matrix. Particularly i´d need the index of the maximum of each row.
The result should be a 484x1 vector or 1x484 with the index of each maximum on each place of the vector.
I tried a few things with find and max and max(abs.... but it seems that the subscription in a matrix does not fit with these functions.
Please help,
Thanks,
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 16 de Jul. de 2012
X = rand(484,1800);
[maxval,idxmax] = max(X,[],2)
and for more info
doc max
1 comentario
Thomas
el 16 de Jul. de 2012
+1 I forgot that max gives the value and index.. :)
Categorías
Más información sobre Creating and Concatenating 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!