concatenate
Show older comments
I have a for-loop that executes commands and displays the answer for each iteration. Please, can someone tell me how to concatenate all the answers into an array instead of having the results displayed independently for each iteration. cheers.
Accepted Answer
More Answers (1)
Paulo Silva
on 28 Mar 2011
a=[]
for b=1:10
a=[a b] %replace the b with the data you want to store per iteration
end
a %result is inside this variable
The code doesn't do any memory pre-allocation!!
Categories
Find more on Logical 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!