MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Wartungshandbuch Seite 41

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 282
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 40
Compiler Directives
2-21
identifier2 specifies the identifier to be used for testing whether the loop was
rolled within the body. For example,
%for Index = <NumNonVirtualSubsystems>3, rollvar="i"
{
int i;
for (i=0; i< %<NumNonVirtualSubsystems>; i++)
{
%body
x[%<rollvar>] = system_name[%<rollvar>];
%endbody
}
}
%endfor
If the number of nonvirtual subsystems (NumNonVirtualSubsystems) is greater
than or equal to 3, the loop is rolled, causing all of the code within the loop to
be generated exactly once. In this case,
Index = 0.
If the loop is not rolled, the text before and after the body of the loop is ignored
and the body is generated
NumNonVirtualSubsystems times.
This mechanism gives each individual loop control over whether or not it
should be rolled.
Note: The %for directive is functional, but it is not recommended. Rather, use
%roll, which provides the same capability in a more open way. RTW does not
make use of the %for construct.
Seitenansicht 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 281 282

Kommentare zu diesen Handbüchern

Keine Kommentare