MATLAB POLYSPACE RELEASE NOTES Uživatelský manuál Strana 136

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 240
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 135
3 Graphics
Specifyi
ng the Axes or Figure
MATLAB al
ways creates an axes o r figure if one does not exist when you
issue a pl
otting command. However, when you are creating a graphics M-file,
it is good
practice to explicitly create and specify the parent axes and figure,
particu
larly if others will use your program. Specifying the parent prevents
the f oll
owing problems:
Your M -f
ile o verwrites the graph in the current figure. Note that a figure
becomes
the current figure wh enever a u ser clicks it.
The curr
ent figure might be in an unexpected state and not behave as
your pro
gram expects.
The foll
owing e xa mple shows a simp le M-file th at plots a fu ncti on and the
mean of
the function over the specified range:
function myfunc(x)
% x = -10:.005 :40; Here's a value you can use for x
y = [1.5*cos(x) + 6*exp(-.1*x) + exp(.07*x).*sin(3*x)];
ym = mean(y);
3-80
Zobrazit stránku 135
1 2 ... 131 132 133 134 135 136 137 138 139 140 141 ... 239 240

Komentáře k této Příručce

Žádné komentáře