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

  • 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 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
Vue de la page 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 281 282

Commentaires sur ces manuels

Pas de commentaire