How to get arg min of an N-dimensional Matrix ?
12 ビュー (過去 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!