Saving the output of a loop into a matrix or a vector
1 view (last 30 days)
Show older comments
Hello,
How can we save the output of a loop when it is a series of matrices
Thank you,
0 Comments
Accepted Answer
Stephen23
on 25 Apr 2015
Edited: Stephen23
on 19 Jun 2019
2 Comments
Stephen23
on 26 Apr 2015
Edited: Stephen23
on 3 Jun 2015
Sorry, I do not use sym, so I have no advice on that. Mixing data (your "states") and the variables' names is what is not recommended, as should be clear from those links.
- You could create a separate (cell?) array to store those states and whose columns correspond to the columns of the data matrix. This would be a typical and easy MATLAB solution.
- You might find that using a table suits your needs better than a simple matrix.
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!