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!