minimum of a matrix

2 visualizaciones (últimos 30 días)
Ellen
Ellen el 21 de Mzo. de 2012
Hi everyone,
In my code I have 3 dimensional matrices and I need the overall minumum of this matrix.
Right now I use : min(min(min(matrix)));
This works fine, but I wonder if there is a function in MATLAB which calculates the minimum of the entire matrix.
Ellen

Respuesta aceptada

Andreas Goser
Andreas Goser el 21 de Mzo. de 2012
The "trick" is not in using a certain command, but to know that your 3 dimensional matrix can be addressed as a vector. Example:
a=rand(2,2,2)
a(:)
min(a(:))
  1 comentario
Ellen
Ellen el 21 de Mzo. de 2012
Thanks so much, I thought I had seen it in codes I have used before, but I couldn't figure out how to do it

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB 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