Writing a program to combine multiple arrays
56 ビュー (過去 30 日間)
古いコメントを表示
I am new to Matlab. How would I write a program to merge two arrays at a time multiple times. I have 13 arrays that need to be merged with each other once. Thank you.
2 件のコメント
回答 (2 件)
Rik
2020 年 5 月 6 日
You can use the square brackets to concatenate arrays, or you can use the cat function.
[A;B;C]
cat(3,A,B,C)
0 件のコメント
Deepak Gupta
2020 年 5 月 6 日
Hello Grace,
You can simply concate 2 or more arrays in below fasion.
If A and B are 2 row arrays and you want A being appended by B, then...
Appended_A_by_B = [A B];
Will give you this result.
If A and B are column arrays then....
Appended_A_by_B = [A; B];
There is also a function cat which can be used to concatenate arrays or matrices. You can know more about it here:
Cheers
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!