how to superimpose three matrix

조회 수: 1 (최근 30일)
Hana
Hana 2014년 8월 8일
답변: Iain 2014년 8월 8일
A = [ nan 2 1; nan nan 4; 8 nan 7] B = [9 nan nan;nan 4 nan;nan nan nan] C = [nan nan nan;3 nan nan; nan 5 nan] result =[ 9 2 1 ;3 4 4;8 5 7)

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 8월 8일
out=max(A,B)
out=max(out,C)

추가 답변 (1개)

Iain
Iain 2014년 8월 8일
One method:
ActualMatrix(:,:,1) = A;
ActualMatrix(:,:,2) = B;
ActualMatrix(:,:,3) = C;
AcutalMatrix(isnan(ActualMatrix)) = 0;
answer = sum(ActualMatrix,3);

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by