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 个)

Not exactly sure what you want, but here is code to find the minimum value:
x = rand(2,2);
m = min(x(:));

类别

帮助中心File Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by