Simulink: return values of simulation
4 ビュー (過去 30 日間)
古いコメントを表示
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151344/image.jpeg)
After I run the simulation with specific parameters, I get the following result.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151346/image.jpeg)
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
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 3 月 1 日
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)
その他の回答 (1 件)
ChristianW
2013 年 3 月 1 日
Check out the Sinks-Library. There are Display-, To Workspace- and To File Blocks.
2 件のコメント
Andreas Goser
2013 年 3 月 1 日
In addtion there is the out block and you can set the scope accordingly.
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!