Simulink: return values of simulation

8 visualizzazioni (ultimi 30 giorni)
Hi,
My question is how I can take out (to Matlab) values from simulink simulations at specific time step?
In my example I have simple spring model. The scheme is below:
After I run the simulation with specific parameters, I get the following result.
How can I get value of position y=0.2 at time step = 80 from simulink to matlab?
Basically, I need to get final simulation results, after system equilibrates.
Thank you

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 1 Mar 2013
In your scope, click on parameter icone, then History, then check save data to workspace, and set the variable name to data for example and the format to structure with time. Lunch simulation, in windows command type
t=data.time
y= data.signals.values
plot(t,y)

Più risposte (1)

ChristianW
ChristianW il 1 Mar 2013
Check out the Sinks-Library. There are Display-, To Workspace- and To File Blocks.
  2 Commenti
Andreas Goser
Andreas Goser il 1 Mar 2013
In addtion there is the out block and you can set the scope accordingly.
Timur
Timur il 4 Mar 2013
Thanks, that also worked.

Accedi per commentare.

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by