How do I insert one array into another?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Chunru
il 25 Ago 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrices and Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!