find all minimum elements of 2 dimensional array in Matlab

偶尔善良 提交于 2019-12-01 17:49:11

find will do the trick:

[I,J] = find(A == min(A(:)) );

disp([I J])
   2   1
   2   4
   3   4

I belive this should work

[row,col]=find(a==min(a(:)))

where a is your matrix. Find can also output a linear index if you give just one output.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!