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

조회 수: 3 (최근 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

댓글을 달려면 로그인하십시오.

답변 (1개)

Ive J
Ive J 2020년 12월 18일
A = [1 1 1 1]
B = [0 0 1 0 1 0]
C = [B, A];

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by