MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Betriebsanweisung Seite 9

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 210
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 8
Introduction
1-3
Figure 1-1: The Relationship Between an S-Function Block, Its Dialog Box,
and the Source File That Defines the Block’s Behavior
In this example, the model contains two instances of an S-Function block. Both
blocks reference the same source file (
mysfun, which can be either a C MEX-file
or an M-file). If both a C MEX-file and an M-file exist with the same name, the
C MEX-file takes precedence and is the file that the S-function uses.
You can use Simulink’s masking facility to create custom dialog boxes and
icons for your S-Function blocks. Masked dialog boxes can make it easier to
specify additional parameters for S-functions. For discussions of additional
parameters and masking, see Using Simulink.
A model that includes
two S-Function blocks
S-Function dialog box
S-Function1 dialog box
S-function
source file
/*
* MYSFUN
*
*/
/* The follo
#define S_FU
.
.
.
function[sys
% mysfun M-file
%
switch(flag)
.
.
.
C MEX-file
M-file
or
Seitenansicht 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 209 210

Kommentare zu diesen Handbüchern

Keine Kommentare