Preferences from the tool window). MATLAB automatically saves them for use
in later sessions.
2.6.3 Scale factors
Enter the following commands (MATLAB’s response is also shown).
format compact
x = [1e3 1 1e–4]
x =
1.0e+003 *
1.0000 0.0010 0.0000
With format short (the default) and format long, a common scale factor is
applied to the whole vector if its elements are very large or very small or differ
greatly in magnitude. In this example, the common scale factor is 1000, so the
elements displayed must all be multiplied by it to get their proper value—for
example, for the second element 1.0e+003 * 0.0010 gives 1. Taking a factor
of 1000 out of the third element (1e–4) leaves 1e–7, which is represented by
0.0000 since only four decimal digits are displayed.
If you don’t want a scale factor, try format bank or format short e:
>>format bank
>>x
x =
1000.00 1.00 0.00
>>format short e
>>x
x =
1.0000e+003 1.0000e+000 1.0000e–004
Do'stlaringiz bilan baham: |