MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuel de service Page 41

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 282
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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.
Vue de la page 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 281 282

Commentaires sur ces manuels

Pas de commentaire