I've wondered about this for a while now. When Matlab prints the matrix A, for instance, with
A
it sometimes appears in scientific notation such as
A =
1.0e+03 *
0 0 0.0070 0.0080 0.0030 0.0010
0 0.0030 -0.0460 0.0400 -0.0930 0.1800
0.0010 -0.0530 -0.0140 -0.0620 0.0790 -1.2360
0.0020 0.0009 -0.0032 0.0016 0.0023 -1.4180
0.0070 -0.0000 -0.0006 -0.0000 0 0
Does anyone know how to make it print normal floating point numbers? I've tried format short, format long, format short e, format long e, but none of them work. Some switch the formatting so that the scientific notation is within individual entries, but really these numbers aren't that ridiculous to just print out...
Scientific notation For example, 1,400,000 can be written as 1.4 x 106. In MATLAB (and other programming languages) a convenient shorthand for this is 1.4e6. The diameter of a carbon nanotube is 5.2nm. Use scientific notation to enter this value in metres.
you can use "format short g" command in the start of the code. I am a fresher in matlab but as far as i know it can help to get rid of e in the answer. Sign in to comment. Sign in to answer this question.
>> 1.0e+03. ans = 1000.
You can use:
format shortG
See format documentation for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With