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

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

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개)

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2012년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by