format
Specify format for printing real numbers.
format short
format medium
format long
format short e
format medium e
format long e

Description
In short format, only two digits following the decimal point are printed. In medium format, only four digits following the decimal point are printed. In long format, only 15 digits following the decimal point are printed. If e is specified, the numbers are printed in the exponential format.
Example
>>format short e
>>pi
      3.14e+000
>>a=rand(2,4)
>>a
      2.79e-001      4.20e-001      5.09e-001      2.50e-001
      9.73e-002      1.18e-001      4.14e-001      9.87e-001

>>format short
a 0.28 0.42 0.51 0.25 0.10 0.12 0.41 0.99 >>format medium >>a 0.2795 0.4202 0.5089 0.2504 0.0973 0.1181 0.4136 0.9869 >>format medium e >>a Columns 1 through 3 2.7947e-001 4.2018e-001 5.0888e-001 9.7335e-002 1.1813e-001 4.1364e-001 Column 4 2.5042e-001 9.8693e-001 >>format long >>a Columns 1 through 3 0.279473859646011 0.420184791938853 0.508882143565249 0.097335212205369 0.118127435936382 0.413637276364539 Column 4 0.250418785493959 0.986934765508719 >>format long e >>a Columns 1 through 2 2.794738596460108e-001 4.201847919388531e-001 9.733521220536856e-002 1.181274359363822e-001 Columns 3 through 4 5.088821435652488e-001 2.504187854939587e-001 4.136372763645392e-001 9.869347655087195e-001