Need help saving an array into a variable and using that variable during the same simulation.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hello,
So I am trying to register a specific number or array during a simulation and assign it to a variable which I can use during the same simulation. Using the TO WORKSPACE does not help my problem as the data will be saved and can be used in the next simulation when the current simulation is stoped. It would be great if someone can help me with that. what are my options ? would s function help?
Answers (1)
Walter Roberson
on 8 Mar 2018
Edited: Walter Roberson
on 8 Mar 2018
0 votes
Put it into a signal that you attach as needed, or register global data. https://www.mathworks.com/help/simulink/ug/using-global-data-with-the-matlab-function-block.html
4 Comments
rami ghali
on 8 Mar 2018
Edited: rami ghali
on 8 Mar 2018
Walter Roberson
on 8 Mar 2018
Syms ? As in the Symbolic Toolbox? It is difficult to use the symbolic toolbox with Simulink.
rami ghali
on 9 Mar 2018
Walter Roberson
on 9 Mar 2018
Is this intended to be something that varies with time? Or is it something that you calculate once and then remains unchanged until the end of the simulation? If it is calculated once then can it be calculated at initialization time?
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!