MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Instrukcja Obsługi Strona 66

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 282
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 281 282

Komentarze do niniejszej Instrukcji

Brak uwag