Toggles the script interpreter between 2 output precision states. The commands ? (print, display) and num2str use this state to set the digits of precision for output.
Syntax |
Description |
---|---|
format long; |
Set script interpreter to 16 digits of precision. |
format short; |
Set script interpreter to 6 digits of precision (maximum). |
Examples
Print \(\pi\) to screen in both output formats.
format short; ?pi; result: 3.14159
format long; ?pi; result: 3.141592653589793
The behavior of the short and long format.
format short; ?1; result: 1
format long; ?1; result: 1.000000000000000
See Also
List of commands , num2str , ?