02.03.2016 Views

MATLAB by rudra pratap

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

244 Computer Algebra and The Symbolic Math Toolbox<br />

MuP AD output appears in blue and follows the input command. Graphical output<br />

, including animations, gets embedded in the output too.<br />

Text comments can be added before each command line and appear in black.<br />

Thus , the notebook is a convenient way of not just doing computation in Mu­<br />

PAD but also preparing reports on your work simultaneously. You can save these<br />

notebooks and reopen them later to continue working from where you had left last<br />

time.<br />

Note the following distinct features of the notebook layout (see Fig. 8.1) :<br />

• Work area: This is the main part of the Notebook window where you type<br />

commands and see the output.<br />

• Command Bar: Located on the right of the work area, this bar contains a<br />

list of mathematical icons for most frequently performed calculations. Clicking<br />

on an icon types out the corresponding command in the work area with<br />

placeholders for the required input variables from the user.<br />

• The menu bar: The menu har on top of the window (below the name bar<br />

of the notebook) has the usual icons that you expect in all window interfaces.<br />

However, this bar is context sensitive and changes with what kind of object<br />

your cursor is placed on. When the cursor is on a graphical object that has<br />

animation, the menu bar brings up controls for playing the animation.<br />

• Command sensitive on-line help: If you place your cursor on a command<br />

(i.e., name of a function) you have typed and left click the mouse, you get<br />

a menu from where you can access on-line help on that command, displayed<br />

in a separate MuPAD help window. You can always access the help window<br />

from the Help menu of MuPAD.<br />

Three basic things about syntax<br />

1 . Variable assignment is done with ': =' and NOT with '=' as in <strong>MATLAB</strong>.<br />

Thus, you must type f := x-2 +1 or x := 5 in MuPAD notebook.<br />

2. Output suppression is done with ':' at the end of the command and NOT<br />

';' as in <strong>MATLAB</strong>. Thus, to suppress the output, type f : = Cx-2 +1) : .<br />

3. Recalling the previous answer is done with '%' and NOT ans as in MAT­<br />

LAB. Thus typing, subs (%, x=a) will substitute a for x in the previous answer.<br />

8.5.1 Graphics and animation<br />

MuPAD has extensive graphics capability. The number of graphics functions and<br />

the ease with which one can use various options for rendering graphs is outstanding.<br />

Strangely enough, most of these functions are not available through the Symbolic<br />

Math Toolbox. You must access these functions through the MuPAD Notebook.<br />

MuPAD provides a whole suite of graphics primitives, such as point, line, arc,<br />

box, circle, ellipse (both in 2-D and 3-D), and surface, cone, cylinder, sphere, etc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!