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

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 282
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 281 282

Kommentare zu diesen Handbüchern

Keine Kommentare