Set Command Window output display format
format
changes
the output display format in the Command Window to the format specified
by style
style
.
format
, by itself, resets the output format
to the default, which is the short, fixed-decimal format for floating-point
notation and loose line spacing for all output lines.
Numeric formats affect only how numbers appear in Command Window output, not how MATLAB® computes or saves them.
The specified format applies only to the current MATLAB session. To maintain a format across sessions, choose a Numeric format or Line spacing option in the Command Window preferences.
You can insert a space between short
or long
and
the presentation type, for instance, format short E
.
MATLAB always displays integer data types to
the appropriate number of digits for the data type. For example, MATLAB uses
3 digits to display int8
data types (for instance,
-128:127). Setting the output format to short
or long
does
not affect the display of integer-type variables.
Integer-valued, floating-point numbers with a maximum of 9 digits do not display in scientific notation.
If you are displaying a matrix with a wide range of
values, consider using shortG
. See Large Data Range Format.