Graphics Programs Reference
In-Depth Information
reevaluatetheentireselectionbychoosing EvaluateCell .Youcanreevaluate
the entire M-book at any time by choosing Evaluate M-book . If your M-book
contains a loop, you can evaluate it by selecting it and choosing Evaluate
Loop , or for that matter Evaluate Cell , provided the entire loop is inside a
single input cell.
It is often handy to purge all output from an M-book before saving, to
economize on storage space or on time upon reopening, especially if there
are complicated graphs in the document. If there are any input cells that you
want to automatically evaluate upon opening of the M-book, select them and
click on Define Auto Init Cell . The color of the text in those cells will change.
If you want to separate out a series of commands, say for repeated evaluation,
then select the cells and click on Define Calc Zone . The commands selected
will be encased in a Word section (withsection breaks before and after it). If
you click in the section and select Evaluate Calc Zone from the Notebook
menu, the commands in only that zone will be (re)evaluated.
The last two buttons are also useful. The button Bring MATLAB to Front
does exactly that; it reveals the MATLAB Command Window that has been
hiding behind the M-book. You may want to enter a command directly into the
Command Window (for example, a help entry) and not have it in your M-book.
Finally, the last button, Notebook Options brings up a panel in which you
candosomecustomizationofyourM-book:setthenumericalformat,establish
the size of graphics figures, etc. We find it most useful to decrease the default
graphics size — the “factory setting” is generally too large. Decreasing the
figure size with Notebook Options may not work withWord 2000, thoughit
is still possible to change the size of figures one at a time, by right clicking on
the figure and then choosing the “Size” tab from Format Object... .
M-Book Graphics
All MATLAB commands that generate graphics work in M-books. The figure
produced by a graphics command appears immediately below that command.
However, one must be a little careful in planning and executing graphics
statements. For example, if in an attempt to reproduce Figure 5-3, you type
ezcontour('xˆ2 + yˆ2', [-3 3], [-3 3]) and CTRL+ENTER , this will
yield the level curves of x 2
+ y 2 , but they will appear elliptical because you
forgot the command axis square . If you enter that command on the next
line, you will get a second picture that will be correct. But a much better
strategy — and one that we strongly recommend — is to return to the original
input cell and edit it by adding a semicolon (or a carriage return) and the axis
Search WWH ::




Custom Search