How do i get the position of the minimum value in at 3 dimensional array?

2 次查看(过去 30 天)
If I have a 3 dimensional array, an I want to find the position of the minimal value of that array, preferably in vector form, what command do I use?

回答(1 个)

Matt J
Matt J 2016-12-29
编辑:Matt J 2016-12-29
minval=min(yourArray(:));
[xloc,yloc,zloc] = ind2sub(size(yourArray), find(yourArray==minval) )

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by