find min or max value element from more than two matrices
Show older comments
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?
Accepted Answer
More Answers (1)
Image Analyst
on 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 Comments
dpb
on 2 Jun 2014
Edited: Image Analyst
on 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
on 2 Jun 2014
Much more efficient.
+1
Categories
Find more on Robust Control Toolbox 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!