how to store a vector that i got from a for loop ?
4 views (last 30 days)
Show older comments
Sandra Minerva Gelista López
on 23 Jun 2019
Commented: Sulaymon Eshkabilov
on 23 Jun 2019
i need put all results in the same vector, the vector A only show me the last result in the for loop
for i=1:3
a=[2+i,i]
d=[5+2*i, 3*i]
endfor
A=[a' d' ]
2 Comments
Accepted Answer
Sulaymon Eshkabilov
on 23 Jun 2019
Hi,
Here is the solution to your loop based script to save all values:
for i=1:3
a(i, :)=[2+i,i]
d(i, :)=[5+2*i, 3*i]
end
A=[a' d' ]
Good luck.
6 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!