Page 118 - A Guide to MATLAB for Beginners and Experienced Users
P. 118
A Warning 99
unnecessary in the M-book mode. For example, the commands pause and
keyboard serve no purpose. In addition the UP- and DOWN-ARROW keys on the
keyboard cannot be used as they are in a Command Window. Those keys cause
your cursor to travel in the Word screen rather than to scroll through previous
input commands. For navigating in the M-book, you will likely find the scroll
bar and the mouse to be more useful than the arrow keys.
You may want to run script or function M-files in an M-book. You still must
take care of pathbusiness as you do in a Command Window. But assuming you
have done so, M-files are executed in an M-book exactly as in a Command Win-
dow. You invoke them simply by typing their name and pressing CTRL+ENTER.
The outputs they generate, both intermediate and final, are determined as
before. In particular, semicolons at ends of lines are important; the command
echo works as before; and so do loops. One thing that does not work so well
is the command more. We have found that, even if more on is executed, help
commands that run on for more than a page do not come out staggered in an
M-book. Thus you may want to bring MATLAB to the foreground and enter
your help requests in the Command Window.
Another standard MATLAB feature that does not work so well in M-books is
the...construct for continuing a long command entry on a second line. Word
automatically converts three dots into a single special ellipsis character and
so confuses MATLAB. There are two ways around this difficulty. Either do not
use ellipses (rather simply continue typing and allow Word to wrap as usual —
the command will be interpreted properly when passed to MATLAB) or turn off
the “Auto Correct” feature of Word that converts the three dots into an ellipsis.
This is most easily done by typing CTRL+Z after the three dots. Alternatively,
open Tools : Auto Correct... and change the settings that appear there.
One final comment is in order. Another reason to bring MATLAB to the
foreground is if you want to use the Current Directory browser, Workspace
browser, or Editor/Debugger. The relevant icons on the tool bar or buttons on
the menu bar can only be found in the MATLAB Desktop, not in the Word
screen. However, you can also type pathtool, workspace,or edit directly
into the M-book, followed by CTRL+ENTER of course.
A Warning
The ellipsis difficulty described in the last section is not an isolated difficulty.
The various kinds of automatic formatting that Word carries out can truly
confuse MATLAB. Several suchinstances that we find particularly annoying
1
are: fractions (1/2 is converted to a single character / 2 representing one-half);