MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de Serviço Página 41

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 282
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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.
Vista de página 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 281 282

Comentários a estes Manuais

Sem comentários