필터 지우기
필터 지우기

convert to s-function level 2

조회 수: 4 (최근 30일)
dab483
dab483 2013년 3월 19일
In s-funcion level 1, i have this
function sys=mdlGetTimeOfNextVarHit(t,x,u)
sampleTime = 1; % Example, set the next hit to be one second later.
sys = t + sampleTime;
how do i convert to s-function level 2? thanks
  댓글 수: 2
Kaustubha Govind
Kaustubha Govind 2013년 3월 19일
At what flag value is this function called?
dab483
dab483 2013년 3월 27일
- mdlUpdate

댓글을 달려면 로그인하십시오.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 3월 27일
Please look at the third row on this table. You should simply need to register mdlGetTimeOfNextVarHit as your Update function in the setup method:
block.RegBlockMethod('Update' ,@mdlGetTimeOfNextVarHit);
Also, as a general suggestion, can I recommend that you change the name of mdlGetTimeOfNextVarHit to something more appropriate like 'Update'? C S-functions actually do have a method called mdlGetTimeOfNextVarHit, and it is best to avoid confusion with that.

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by