element in 2D array
조회 수: 1 (최근 30일)
이전 댓글 표시
how can find minimun element in 2D array
댓글 수: 0
채택된 답변
Walter Roberson
2013년 2월 5일
편집: Walter Roberson
2013년 2월 5일
[minval, minpos] = min(YourArray(:));
[minrow, mincol] = ind2sub(size(YourArray), minpos);
The above if you want to know the row and column as well as the value. If you just want the value then
minval = min(YourArray(:));
댓글 수: 0
추가 답변 (1개)
James Tursa
2013년 2월 5일
Not exactly sure what you want, but here is code to find the minimum value:
x = rand(2,2);
m = min(x(:));
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!