Add multiple elements to array
93 views (last 30 days)
Show older comments
Hi,
Is there possible to add more than one element to an array at the same time?Like in this array:
x=[];
x=[x,3];%and I want to add a number of 100 3 in x
5 Comments
Accepted Answer
KALYAN ACHARJYA
on 30 May 2021
Edited: KALYAN ACHARJYA
on 30 May 2021
Yes it's OK, horizontal concatenation
x=[x,3]
Example:
>> x=1:4
x =
1 2 3 4
>> x=[x,9:12]
x =
1 2 3 4 9 10 11 12
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!