GUI-Simulink

Sir/Madam, I have two questions. 1. How to make a simulink model to stop simulation using a push button in GUI? am making use of sim command to start simutaion. Suppose the name of model is final_guidance_4.
2. In the same model mentioned above, I want user to input the value of forward velocity in GUI edit text box. this value is to be stored source block parameter "u" which would be a constant. Please guide me

回答 (1 件)

Gerd
Gerd 2011 年 6 月 30 日

0 投票

Hi Nitesh,
you can use
set_param(gcs, 'SimulationCommand', 'start')
or
set_param(gcs, 'SimulationCommand', 'stop')
to start and stop the current simulink simulation
To change the value of a constant block simple write
u = 'something new';
Gerd

2 件のコメント

Nitesh
Nitesh 2011 年 6 月 30 日
Sir where to write u='something new". I mean I wanna connect it to the text of edit text box in my GUI??
Gerd
Gerd 2011 年 6 月 30 日
In your simulink model use a constant block with a "constant value" of "u" Now "u" is a variable which you can change from the workspace or from a gui. In the callback of your edit text box simply write
u = str2num(get(editbox,'String')) and the value of "u" is changed by the GUI

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

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

質問済み:

2011 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by