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 eitherlong
orlongE
, whichever is shorter for each element. Same can be done withformat 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 atformat
in the documentation to see all the options.Example: