How to assign new values to the simulink model blocks while it is executing

1 回表示 (過去 30 日間)
Arun Badigannavar
Arun Badigannavar 2013 年 1 月 21 日
function pushbutton1_Callback(hObject,eventdata)
Final_Result=[];
open_system('Desktop\test_Final.slx')
for i=15
set_param('test_Final','StopTime', sprintf('%d',i));
set_param('test_Final','Simulationcommand','start');
options = simset('SrcWorkspace','base');
end
function pushbutton2_Callback(hObject,eventdata)
pause(0.44)
b=5
assignin('base','b',b)
set_param('test_Final','Simulationcommand','continue');
set_param('test_Final','Simulationcommand','update');
end
How to change the value of b,,,which is constant block im my model,,i just want to change the value of constant block ,,,while simulink model is executing
  2 件のコメント
Kaustubha Govind
Kaustubha Govind 2013 年 1 月 21 日
It looks like you are already changing the value of 'b' in the workspace and running set_param('test_Final','Simulationcommand','update') - does this not work?
Arun Badigannavar
Arun Badigannavar 2013 年 1 月 22 日
Thanks for reply,,,it works

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

回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by