How to combine two arrays

3 ビュー (過去 30 日間)
MIch
MIch 2022 年 9 月 30 日
コメント済み: MIch 2022 年 9 月 30 日
Hello,
for example there are a= [3 5 1] and b = [4 6 7]
How can I combine a and b to get c= [3 4 5 6 1 7]?

採用された回答

Robert U
Robert U 2022 年 9 月 30 日
Hi MIch,
have a look in the documentation under language fundamentals --> reshape()
a = [3 5 1];
b = [4 6 7];
c= reshape([a' b']',1,[])
c = 1×6
3 4 5 6 1 7
Kind regars,
Robert
  1 件のコメント
MIch
MIch 2022 年 9 月 30 日
Thank you very much

サインインしてコメントする。

その他の回答 (1 件)

zhehao.nkd
zhehao.nkd 2022 年 9 月 30 日
Try reshape([a;b],1,[])
  1 件のコメント
MIch
MIch 2022 年 9 月 30 日
Thank you very much

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by