How can I find the maximum value in a matrix?
57 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How can I find the maximum value in a matrix and find its column and row number of this value?
0 comentarios
Respuesta aceptada
Andrei Bobrov
el 14 de Jun. de 2013
A = randi(100,7,6); % your matrix
v = max(A(:)); % value
[ii,jj] = find(A == v); % row and column number
0 comentarios
Más respuestas (1)
Image Analyst
el 14 de Jun. de 2013
maxValue = max(yourMatrix);
[row column] = find(yourMatrix==maxValue);
Or you can take the second returned argument from max() and use ind2sub().
0 comentarios
Ver también
Categorías
Más información sobre Resizing and Reshaping 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!