convert to s-function level 2
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Kaustubha Govind
il 27 Mar 2013
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.
0 Commenti
Vedere anche
Categorie
Scopri di più su Block and Blockset Authoring in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!