how to superimpose three matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hana
am 8 Aug. 2014
Beantwortet: Iain
am 8 Aug. 2014
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)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Iain
am 8 Aug. 2014
One method:
ActualMatrix(:,:,1) = A;
ActualMatrix(:,:,2) = B;
ActualMatrix(:,:,3) = C;
AcutalMatrix(isnan(ActualMatrix)) = 0;
answer = sum(ActualMatrix,3);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!