I have a vector that is caluculated in a script.
After calculation, I display the values to the command window. It is displayed as follows:
finalResults =
1.0e+05 *
0.0001
0
0.0005
0.0002
0.0001
0.0027
0.0033
0.0001
-0.0000
-0.0000
1.3750
0.0066
How do I make it display with the real values (i.e. with the 1.0e+05
multiplied in)?
format longG
should do the trick. This uses either long
or longE
, whichever is shorter for each element. Same can be done with format shortG
if you want shorter sequences.
The reason MATLAB displays numbers like in your question, is because this is the format short
way of doing things. Look at format
in the documentation to see all the options.
Example:
format shortG
A = [1;1e10;-1];
A =
1
1e+10
-1
format longG
A =
1
10000000000
-1