- Add a "To Workspace" block for each signal you want to save (x1, x2, x3, etc.) and connect it to its respective signal.
- Configure the "To Workspace" block to have a desired variable name (like x1, x2, x3, etc.) and set the sample time (e.g., 10 for sampling every 10 seconds).
- The default output type of "To Workspace" block is "Timeseries". You can change it to "Array" for ease of use. After running the simulation, you can access the data as "out.x1" and use it for further computation. Assuming that the sample time for the signals is 10 s, you can access the data at time 20 s as "out.x1(3)".
Creater a vector front a signal data in specific time intervals
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a equations systems in simulink, that give the direfential equations solutions
In specific times of simulation, for example at 10, 20, 30.. [x1 x2 x3] until the 1000000 and thus,
I need one of these signals in a vector that I can access to compute the diference beetwem samples during the entirely simulation.
For example at 20 seconds i need to know what is x2-x1..
thanks guys,,,,
0 commentaires
Réponses (1)
Samay Sagar
le 1 Mar 2024
In Simulink, the "To Workspace" block offers a convenient way to export the output of your simulation directly to the MATLAB workspace. Subsequently, you can use the output in the workspace to access values of signals at specific timestamps for further computation.
Here is a step-by-step guide to achieve this:
You can read more about the "To Workspace" block here:
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!