MATLAB POLYSPACE RELEASE NOTES Manual do Utilizador Página 164

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 240
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 163
4 Programming
Like other functions, a neste d function has its own workspace where variables
used by the function are stored. B ut it also has a ccess to the w orkspaces
of all functions in which it is nested. So, for example, a variable that has
a value assigned to it by the primary function can be read or overwritten
by a function nested at any level w ithin the prim ary. Similarly, a variable
that is assigned in a nested function can be read or overwritten by any of the
functions containing that function.
Function Overloading
Overloaded functions act the same way as overloa d ed fun cti on s in most
computer languages. Overloaded functions are useful when you need to create
a function that responds to different types of inputs accordingly. For instance,
you might want one of your functions to accept both double-precision and
integer input, but to handle each type somewhat differently. You can make
thisdifferenceinvisibletotheuserbycreating two separate functions having
thesamename,anddesignatingonetohandle
double types and one to
handle integers. When you call the function, MATLAB chooses which M-file
to dispatch to based on the type of the input arguments.
Global Variables
If you want more than one function to share a single copy of a variable, simply
declare the variable as
global in all the functions. Do the same thing at
the command line if you want the base w orkspace to access the variable.
The global declaration must occur before the variable is actually used in a
function. Although it is not required, using capital letters for the names of
global variables helps distinguish them from other variables. For example,
create an M-file called
falling.m:
function h = f alling(t)
global GRAVITY
h = 1/2*GRAVITY*t.^2;
Then interactively enter the statements
global GRAVITY
GRAVITY = 32;
y = falling((0:.1:5)') ;
4-26
Vista de página 163
1 2 ... 159 160 161 162 163 164 165 166 167 168 169 ... 239 240

Comentários a estes Manuais

Sem comentários

Seiwa Sprzęt wodny podręczniki użytkownika

Lista Seiwa Sprzęt wodny produkty zawierają 22 instrukcje obsługi do modeli 14. Wszystkie podręczniki użytkownika w formacie pdf są dostępne do pobrania lub obejrzenia online.

Kliknij na poniższy alfabet, aby przejść do pełnej listy modeli zaczynających się od tej litery

Modele Rodzaj dokumentu
Explorer 3(v.7.0)
Instrukcja Użytkownika   Seiwa Explorer 3(v.7.0) User Manual, 8 strony
Instrukcja Użytkownika   Seiwa Explorer 3(v.7.0) Benutzerhandbuch, 8 strony
Instrukcja Użytkownika   Seiwa Explorer 3(v.7.0) Manuel d'utilisation, 8 strony
FT70 multi-touch
Instrukcja Użytkownika     Seiwa FT70 multi-touch User Manual, 2 strony
Marlin(v.16.31)
Instrukcja Użytkownika   Seiwa Marlin(v.16.31) User Manual, 12 strony
Radar tuning
Instrukcja Użytkownika   Seiwa Radar tuning User Manual, 14 strony
Seawave 12 MKII
Instrukcja Użytkownika   Seiwa Seawave 12 MKII Manual del usuario, 114 strony
Starfish 2nd Edition
Instrukcja Użytkownika   Seiwa Starfish 2nd Edition User Manual, 118 strony
Instrukcja Użytkownika   Seiwa Starfish 2nd Edition Manuale d'uso, 120 strony
Instrukcja Użytkownika   Seiwa Starfish 2nd Edition Benutzerhandbuch, 121 strony
SW AP01
Instrukcja Użytkownika   Seiwa SW AP01 User Manual, 52 strony
SW AP03
Instrukcja Użytkownika   Seiwa SW AP03 User Manual, 49 strony
Instrukcja Użytkownika   Seiwa SW AP03 Manuale d'uso, 36 strony
SW RP03
Instrukcja Użytkownika   Seiwa SW RP03 User Manual, 10 strony
SW RP05
Instrukcja Użytkownika   Seiwa SW RP05 User Manual, 6 strony
SW RP07
Instrukcja Użytkownika   Seiwa SW RP07 User Manual, 7 strony
SW701i SW701e
Instrukcja Użytkownika   Seiwa SW701i SW701e User Manual, 153 strony
Instrukcja Użytkownika   Seiwa SW701i SW701e Manuale d'uso, 157 strony
Instrukcja Użytkownika   Seiwa SW701i SW701e Benutzerhandbuch, 159 strony
Tigershark Plus
Instrukcja Użytkownika   Seiwa Tigershark Plus Manuale d'uso, 128 strony
Instrukcja Użytkownika   Seiwa Tigershark Plus User Manual, 109 strony