how do i execute a matlab script from simulink, not a function, just an mfile to plot a graph?

I have a simulink model and i have exported some of the variables to workspace and i want to plot them. I would have used a scope but I don't want time to be the x-axis. So i wrote an mfile to do a stem plot and i want this script to execute right after the simulation is complete.

1 件のコメント

Ahmed
Ahmed 2022 年 2 月 28 日
Refere to the following mathworks link
https://www.mathworks.com/matlabcentral/answers/22775-running-m-file-from-simulink

サインインしてコメントする。

 採用された回答

Sebastian Castro
Sebastian Castro 2015 年 2 月 4 日

1 投票

Arnold,
You can create Model Callbacks to do this. The one you want to use is probably the StopFcn callback.
- Sebastian

1 件のコメント

Arnold Bradshaw
Arnold Bradshaw 2015 年 2 月 4 日
Sebastian, i was trying to get a handle on the callback routine but i didn't know which one to use. this worked. thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by