matlab - How to I find the maximum value of corresponding elements in multiple matrices? -
i have 4 matrices same dimensions, let's say:
a = 1 2 5 4 2 9 b = 4 5 9 8 0 1 c = 5 3 9 0 4 0 d = 5 9 1 0 9 3
how find maximum value of corresponding elements in 4 matrices? in example, result should follows:
maxabcd = 5 9 9 8 9 9
thank you...
try concatenating 4 matrices along 3rd dimension , invoke max
:
maxabcd = max(cat(3, a, b, c, d), [], 3)
Comments
Post a Comment