How can I make one vector out of two vectors with different lengths?

1 回表示 (過去 30 日間)
Simon Peeters
Simon Peeters 2020 年 12 月 18 日
コメント済み: Simon Peeters 2020 年 12 月 18 日
Is it possible to make one vector out of two vectors with different lengths?
A = [1 1 1 1]
B = [0 0 1 0 1 0]
--> C = [0 0 1 0 1 0 1 1 1 1]
Thank for your help!
  2 件のコメント
Mathieu NOE
Mathieu NOE 2020 年 12 月 18 日
sure
C = [B A]; % horizontal concatenation
C = [B(:); A(:)]; % vertical concatenation
Simon Peeters
Simon Peeters 2020 年 12 月 18 日
Thanks a lot!

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

回答 (1 件)

Ive J
Ive J 2020 年 12 月 18 日
A = [1 1 1 1]
B = [0 0 1 0 1 0]
C = [B, A];

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by