
2 Matrices and Arra ys
Controlling Command Window Input and Output
In this section.. .
“The format Function” on page 2-30
“Suppressing Output” on page 2-31
“Entering Long Stateme nts ” o n page 2-32
“Command Line Editing” on page 2-32
The format Function
The format function controls the numeric format of the values displayed by
MATLAB. The function affects only how numbers are displayed, not how
MATLAB co mputes or saves them. Here are the different formats, together
with the resulting output produced from a vecto r
x with components of
different m agnitudes.
Note To ensure proper spacing, use a fixed-w idth font, such as Courier.
x = [4/3 1.2345e-6]
format short
1.3333 0.0000
format short e
1.3333e+000 1.2345e-006
format short g
1.3333 1.2 345e -006
format long
1.33333333333333 0.00000123450000
2-30
Commenti su questo manuale