How do I insert one array into another?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Chunru
2022 年 8 月 25 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!