MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Betriebsanweisung Seite 192

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 210
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 191
4 Guidelines for Writing C MEX S-Functions
4-26
rtY.Out1 = rtb_buffer2;
/* S-Function Block: <Root>/S-Function1 */
{
real_T *xData = &rtP.S_Function1.XData[0];
real_T *yData = &rtP.S_Function1.YData[0];
int_T idx;
idx = GetDirectLookupIndex(xData, 5, rtb_Sine_Wave);
rtb_buffer2 = yData[idx];
}
/* Outport Block: <Root>/Out2 */
rtY.Out2 = rtb_buffer2;
}
/* Perform model update */
void MdlUpdate(int_T tid)
{
/* (no update code required) */
}
/* Terminate function */
void MdlTerminate(void)
{
/* (no terminate code required) */
}
#include “sfun_directlook_ex.reg”
/* [EOF] sfun_directlook_ex.c */
This is the code that is
inlined for the bottom
S-function block i n the
sfun_directlook_ex
model.
Seitenansicht 191
1 2 ... 187 188 189 190 191 192 193 194 195 196 197 ... 209 210

Kommentare zu diesen Handbüchern

Keine Kommentare