Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有四个具有相同维度的矩阵,比方说:
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
如何找到四个矩阵中所有对应元素的最大值?在我的示例中,结果应如下所示:
maxABCD = 5 9 9 8 9 9
谢谢...
尝试沿第三维连接所有四个矩阵,然后调用max:
max
maxABCD = max(cat(3, A, B, C, D), [], 3)
或者以下也应该起作用:
>> max(A,max(B,max(C,D))) ans = 5 9 9 8 9 9