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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 282
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 65
2
Working with the Target Language
2-46
Variable Scoping Within Functions
Within a function, the left-hand member of any %assign statement defaults to
create a new entry in the function’s block within the scope chain, and does not
affect any of the other entries. That is, it is local to the function. For example,
%function foo (x,y)
%assign local = 3
%endfunction
adds local = 3 to the foo( ) block in the scope list giving:
Figure 2-7: Scoping Rules Within Functions Containing Local Variables
Global Pool
%assign a = …
%assign b = …
Top-Level RTW Pool
CompiledModel {
}
%with CompiledModel.
System[Sysidx]
2
3
4
1
%function function(…)
foo (x,y)
local = 3
Vista de página 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 281 282

Comentários a estes Manuais

Sem comentários