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에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by