How can I display the results from simulink to the GUI ?

3 ビュー (過去 30 日間)
xuan hoa
xuan hoa 2021 年 11 月 8 日
回答済み: Githin George 2023 年 12 月 13 日
Hi, I'm currently trying to design an interface using the GUI and I'm trying to put the output from simulink into the edit box in the GUI.
In simulink I have a battery charger circuit and I use Display to output the percentage of battery capacity (SOC), and I added a To workspace block. So now how should I code so that the result is displayed in the edit box in the GUI, hope everyone can help me.

回答 (1 件)

Githin George
Githin George 2023 年 12 月 13 日
Hello Xuan,
It is my understanding that you would like to update a GUI with the output from a Simulink Model during model execution.
You can use various Simulink callbacks and events to sync the GUI with your model. For instance, you can register a listener function using “add_exec_event_listener” function for the ‘PostOutputs’ event of display block. This event is triggered at every time step of model execution. You can add the logic to update your GUI in the listener function.
For a more detailed explanation, you can refer to the following link.
I hope this helps.

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by