store data associated with index in simulink and then export to workspace

1 view (last 30 days)
Hello I have a set of experiments in which I vary a constant number and observe the behavior of a vehicle live from the cameras. I want to record the 1000 samples of x and y coordinates for each of the constant values and store them in workspace. For example: when a = 1 I have an array of 1000 samples of x and y. when a = 2 again i have another 1000 samples and so on. For each a I want to store a separate data array with a different array_name in workspace. Can someone help me do this in simulink?
Thanks Bhargav

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 12 Aug 2015
This is a very bad idea to save your data with different names. Use a to workspace block to have your data in workspace. And one variable name A, it's easy to get each sample:
A(1,:)
A(2,:)
...
and so on
Why do you need to give a new name for each part of your matrix? It's easier to use one variable that contains all what you need, just provide the indices to locate what you want.

More Answers (0)

Categories

Find more on Simulink Environment Customization 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!