How do I insert one array into another?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two arrays with elements of type double. I want to insert the 1st column of array 2 after the 1st column of array 1, the 2nd column of array 2 after the 2nd column of array 1, and so on. How do I do this?
0 Kommentare
Akzeptierte Antwort
Chunru
am 25 Aug. 2022
a = reshape(1:12, 3, 4)
b = reshape(13:24, 3, 4)
% You stack a and b, then reshape it
a = reshape([a; b], 3, 8)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!