how to put simulink model inside a function,which will be called every one second

3 次查看(过去 30 天)
I am trying to implement a simulink model inside function,,where this function is called every one second (using timer in script),and update stop time of the model 1 second each,,,How to do this?
  1 个评论
Arun Badigannavar
Arun Badigannavar 2012-12-20
t = timer('TimerFcn','launch','StartDelay',1);
start(t)
stat=1;
while(true)
% set_param(gcs,'StopTime','inf'
set_param(gcs,'StopTime', sprintf('%d',t));
% set_param(gcs,'StopTime', '10');
set_param(gcs,'Simulationcommand','start')
% pause(1)
% set_param(gcs,'Simulationcommand','pause')
% pause(0.00001)
set_param(gcs,'Simulationcommand','update')
set_param(gcs','Simulationcommand','continue')
% [columns,rows] = size(x_T)
% answer=x_T(columns,rows)
end
if true
% code
end
This is my code

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Downloads 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by