how to find out position of minimum element in a matrix

11 Ansichten (letzte 30 Tage)
Joy Mondal
Joy Mondal am 7 Mai 2018
Beantwortet: Rik am 7 Mai 2018
a=[8 2 5;2 -2 4;9 5 4] here position of minimum value is 2*2

Akzeptierte Antwort

Rik
Rik am 7 Mai 2018
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.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by