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 日

1 投票

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 日

0 投票

Try reshape([a;b],1,[])

1 件のコメント

MIch
MIch 2022 年 9 月 30 日
Thank you very much

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

カテゴリ

ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索

タグ

質問済み:

2022 年 9 月 30 日

コメント済み:

2022 年 9 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by