how to find out position of minimum element in a matrix

 Accepted Answer

a=[8 2 5;2 -2 4;9 5 4] ;
[r,c]=find(a==min(a(:)));
This will even work if there are multiple positions where the minimum value exists: in that case r and c will be vectors.

More Answers (0)

Categories

Asked:

on 7 May 2018

Answered:

Rik
on 7 May 2018

Community Treasure Hunt

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

Start Hunting!