minimum of a matrix

1 次查看(过去 30 天)
Ellen
Ellen 2012-3-21
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

采纳的回答

Andreas Goser
Andreas Goser 2012-3-21
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 个评论
Ellen
Ellen 2012-3-21
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by