element in 2D array

17 次查看(过去 30 天)
Umair Altaf
Umair Altaf 2013-2-5
how can find minimun element in 2D array

采纳的回答

Walter Roberson
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(:));

更多回答(1 个)

James Tursa
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(:));

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by