How can I save and organize sets of vectors to be specifically called later on?

3 views (last 30 days)
I am trying to plot the progression of a spatial function over time, so I would like to store sets of vectors which would be the y values for all x points at a given time. So vector one would be the y-positions of the points for all x values at time 1, vector two would be positions of the points in space at time 2 and so on. I would then like to recall these vectors later on, to graph the progression of the spatial coordinates over time.
No need to go into specifics about what I'm doing, just need to know how to store sets of data points to be later recalled in an organized fashion.

Answers (1)

Guillaume
Guillaume on 19 Feb 2015
Maybe you do need to go into the specifics, or at least explain better what's the problem you're having.
To store something that you want to use later on, you use a variable if the later on is in the same piece of code and matlab session or a file of the format of your choice if the later on if it is in a different session.
As for storing multiple vectors into one variable, the simplest is a cell array. A structure or even a map would also work.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!