The max matrix of two matrices
이전 댓글 표시
Hello,
If I have two N-by-N matrices A and B, how can I find the N-by-by matrix C such that its (m,n)th element is the max of the (m,n)th element in A and the (m,n)th element in B?
Note: I don't want to use a for loop because N is quiet large.
Thanks
채택된 답변
추가 답변 (1개)
Ben11
2014년 8월 7일
Try this:
C = arrayfun(@(x,y) max(x(:),y(:)),A,B)
카테고리
도움말 센터 및 File Exchange에서 Inertial Sensor Fusion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!