Find minimum in matrice
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Miguel Albuquerque
am 16 Jul. 2022
Beantwortet: patrick1704
am 16 Jul. 2022
Hey guys, thanks in advance
I have this matrix, that always has zeros, but also other values. I want to find the minimum of the matrix, besides the zeros, how can I do that?
0 Kommentare
Akzeptierte Antwort
patrick1704
am 16 Jul. 2022
Hi,
If you only care about the value and not the index, you could do something like this:
min(R1_matrix(R1_matrix ~= 0))
If you care about the index you could do something like:
R1_matrix(R1_matrix == 0) = inf;
min(R1_matrix)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!