Hi
I have 2 colimn vectors a = 1:500 and b= 1:6000 I would like to make a new column vector c with (a first) and (b second) so the new column vector would bw c = 1:6500.
Any help would be greatly appreciated
Thank you
David

댓글 수: 1

Scott MacKenzie
Scott MacKenzie 2021년 6월 10일
편집: Scott MacKenzie 2021년 6월 10일
You want to concatenate the vectors a and b. This is one of the most basic operations in MATLAB. All the details are here.

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

 채택된 답변

Max Heiken
Max Heiken 2021년 6월 10일

0 개 추천

Hello,
you can concatenate vectors and matrices vertically with a semicolon like this
c = [a; b];
or concatenate them horizontally with a comma like this
c = [a, b];

댓글 수: 1

Scott MacKenzie
Scott MacKenzie 2021년 6월 10일
Yes indeed, but horizontal concatenation won't work in this case because a is 1x500 and b is1x6000 and both are column vectors.

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

추가 답변 (1개)

KSSV
KSSV 2021년 6월 10일

0 개 추천

MAke a and b of equal dimension using linspace. and then add.
Read about linspace.,

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

릴리스

R2020a

태그

질문:

2021년 6월 10일

댓글:

2021년 6월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by