Programming and Graphics

(Kiana) #1

F.3Matlabcommands 347


input Prompt for user input
keyboard Invoke keyboard as though it were a script file
menu Generate menu of choices for user input

Table F.1.4Matlabinteractive input commands.


format short Fixed point with 4 decimal places (default)
format long Fixed point with 14 decimal places
format short e Scientific notation with 4 decimal places
format long e Scientific notation with 15 decimal places
format hex Hexadecimal format

Table F.1.5Matlabformatting commands.


significant digits, and a range of definition roughly varying between 10−^308 and
10 +308in absolute value. Numbers smaller than 10−^308 or larger than 10+308
in absolute value cannot be accommodated.


Matlabperforms all computations in double precision. However, this
should not be confused with the ability to view and print numbers with a
specified number of significant figures using the commands listed in Table F.1.5.


F.3 Matlabcommands


Once invoked, Matlabresponds interactively to various commands, state-
ments, and declarations issued by the user in theMatlabwindow. These are
implemented by typing the corresponding name, single- or multi-line syntax,
and then pressing theEnterkey.


Table F.3.1 lists general utility and interactive-inputMatlabcommands.
Issuing the commanddemosinitiates various demonstrations and illustrative
examples ofMatlabcode, well worth exploration.


To obtain a full explanation of aMatlabcommand, statement, or func-
tion, we may use theMatlabhelpfacility, which is the counterpart of the
Unixmanfacility. For example, issuing the commandhelp breakin theMat-
labenvironment produces the description:


BREAK Terminate execution of WHILE or FOR loop.
BREAK terminates the execution of FOR and WHILE loops.
In nested loops, BREAK exits from the innermost loop only.
If you use BREAK outside of a FOR or WHILE loop in a MATLAB
script or function, it terminates the script or function at
that point. If BREAK is executed in an IF, SWITCH-CASE, or
TRY-CATCH statement, it terminates the statement at that point.
Free download pdf