How to add elements to the end of an array?
Show older comments
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?
3 Comments
Punnag Chatterjee
on 27 Jan 2018
gamma = [alpha, beta]
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.
Punnag Chatterjee
on 2 Feb 2018
Thanks for this info.
Accepted Answer
More Answers (2)
Also you can enlarge it the of two. In others words:
you have
alpha = [ 1 2 3 4 5]
beta = [ 6 7 8 9 10 11 12]
alpha(6:12)=beta
Mebin A Abraham
on 14 Apr 2020
0 votes
how can i add elements in an array..... suppose A=[ 1 2 3 4]....i want to get sum of the numbers..ie.1+2+3+4=10.........for that what is the function
1 Comment
Dinesh Brindavanam
on 18 Apr 2020
B = sum(A)
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!