Formatting Your MATLAB Output

While all computations in MATLAB are performed in double precision, the format of the displayed output can be controlled by the following commands.

 format short      fixed point with 4 decimal places (the 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

Once invoked, the chosen format remains in effect until changed.

The command format compact will suppress most blank lines, allowing you to place more information on the screen or page. It is independent of the other format commands.


Other Matlab Hints

Click on an item listed below to access additional MATLAB-related hints.


Return to ACS home page.


Please send comments and suggestions to

consult@rpi.edu