MATLAB Answers

How to add elements to the end of an array?

3.582 views (last 30 days)
I have two arrays:
alpha = [ 1 2 3 4 5]; beta = [ 6 7 8 9 10 11 12];
I'd like to add beta to the end of alpha so they form gamma
gamma = [1 2 3 4 5 6 7 8 9 10 11 12];
How would I go about doing this?


Image Analyst
Image Analyst on 27 Jan 2018
Punnag, you can put "Answers" down below in the "Answers" section rather than up here. Though, I doubt there's a need to post a duplicate of the answer down there that was already posted 4 months ago.

Sign in to comment.

Accepted Answer

John Wirzburger
John Wirzburger on 27 Oct 2016
gamma = [alpha beta];


Show 2 older comments
James Tursa
James Tursa on 5 Feb 2018
@ Charles. This comment does not appear to be sufficiently related to the original Question. Suggest you delete this comment and open up a new Question about your specific problem.

Sign in to comment.

More Answers (1)

Mebin A Abraham
Mebin A Abraham on 14 Apr 2020
how can i add elements in an array..... suppose A=[ 1 2 3 4]....i want to get sum of the that what is the function

Community Treasure Hunt

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

Start Hunting!

Translated by