find all minimum elements of 2 dimensional array in Matlab

前端 未结 2 766
滥情空心
滥情空心 2021-01-18 08:52

Having 2-dimensional array,A, I want to find minimum number in the array. However I can have more than one of that number. How can I find the [row col] of all m

2条回答
  •  失恋的感觉
    2021-01-18 09:23

    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.

提交回复
热议问题