How to get arg min of an N-dimensional Matrix ?
33 次查看(过去 30 天)
显示 更早的评论
Hi, i'm having an image of size[280,307,191] and i want to get the argmin of it,Any help?
0 个评论
采纳的回答
James Tursa
2013-4-15
编辑:James Tursa
2013-4-15
[m n] = min(M(:));
[x y z] = ind2sub(size(M),n);
x, y, z will be the indexes (i.e., argmin) of the minimum value of your 3D array M.
2 个评论
Jan
2013-4-16
The documentation of min explains this exhaustively already. Type this in Matlab's command window:
help min
doc min
and read it.
更多回答(3 个)
Cedric
2013-4-15
How do you define argmin? If it is the global min, you can get it as follows:
min(M(:))
where M is your 3D array.
4 个评论
Andrei Bobrov
2016-7-13
编辑:Andrei Bobrov
2016-7-13
Hi Sreeda M A! Example:
M = randi(400,280,307,191);
Sean de Wolski
2013-4-15
Or:
min(min(min(M)))
2 个评论
Ties Hendrickx
2019-4-29
Nope, this will return the minimum value and not the index of the minimum value
Steven Lord
2019-4-30
If you're using release R2019a or later, you probably want to call min with the 'all' dimension input and the 'linear' flag.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!