It should be d = [15 18;21 24] because a,b and c all are of 2*2 order.
my question is if a=[1 2;3 4],b=[5 6;7 8],c=[9 10;11 12] the resultant matrix should be d=[1 5 9;2 6 10;3 7 11;4 8 12] this should be done using for loop?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sravankumar v
am 11 Aug. 2017
Kommentiert: DGM
am 13 Jan. 2025
my question is if a=[1 2;3 4],b=[5 6;7 8],c=[9 10;11 12]
the resultant matrix should be d=[1 5 9;2 6 10;3 7 11;4 8 12] this should be done using for loop?
2 Kommentare
DGM
am 13 Jan. 2025
Nobody suggested that the goal was to take the sum. The given result for d is clearly done by reshaping the contents of a, b, and c as is shown in the other comments.
a = [1 2;3 4];
b = [5 6;7 8];
c = [9 10;11 12];
d = reshape([a; b; c].',[],3)
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
