finding the position of the minimum element in the matrix
Show older comments
hello. i need to know the position of the minimum element of the matrix. For example
M= [1 5 7; 2 4 5 ]
M=
1 5 7
2 4 5
the min is 1 and it's position is (1,1).
How can i find this?
Thanks
Accepted Answer
More Answers (1)
madhan ravi
on 12 Apr 2020
Edited: madhan ravi
on 12 Apr 2020
MIN = min( M(:) );
[ Row, Column ] = ind2sub( size(M), find(MIN == M, 1 ) )
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!