MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guide de l'utilisateur Page 44

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 210
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 43
2 Writing S-Functions As M-Files
2-20
function sys = mdlOutputs(t,x,u)
sys = x(1);
% end mdlOutputs
%
%==============================================================
% mdlGetTimeOfNextVarHit
% Return the time of the next hit for this block. Note that the
% result is absolute time.
%==============================================================
%
function sys = mdlGetTimeOfNextVarHit(t,x,u)
sys = t + u(2);
% End of mdlGetTimeOfNextVarHit.
mdlGetTimeOfNextVarHit
returns the “time of the next hit,” the time in the
simulationwhen
vsfunc isnext called. Thismeans that thereis no outputfrom
this S-function until the time of the next hit . In
vsfunc, the time of the next hit
is set to
t + u(2), whichmeans that the secondinput, u(2), sets thetime when
the next call to
vsfunc occurs.
Passing Additional Parameters
Simulink always passes t, x, u,andflag into S-functions. It is poss ible t o pass
additional parameters into yo ur M-file S-function . For an examp le of how to d o
this, se e
limintm.m in the toolbox/simulink/blocks directory.
Vue de la page 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 209 210

Commentaires sur ces manuels

Pas de commentaire