find min or max value element from more than two matrices
Ältere Kommentare anzeigen
I know how we can find min or max value element from two matrices. For more than two matrices we can do two by two and then compare but I was wondering if there is any other simple way to find min or max value element from more than two matrices?
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 2 Jun. 2014
For 3 matrices, you can do
minValue = min([a(:);b(:);c(:)])
maxValue = max([a(:);b(:);c(:)])
It's easy to see how to adapt it for more matrices.
2 Kommentare
dpb
am 2 Jun. 2014
Bearbeitet: Image Analyst
am 2 Jun. 2014
Good 'un to use (:) to avoid the dimensions problem...don't know why didn't think of it. I removed the sorrier response.
Star Strider
am 2 Jun. 2014
Much more efficient.
+1
Kategorien
Mehr zu Robust Control Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!