1.0e+02 *

33 views (last 30 days)
Sergey Dukman
Sergey Dukman on 9 May 2015
Commented: Star Strider on 9 May 2015
Hei!
Can somebody help me with this:
After running for-loop (for example, for I=1:10 [I, I^2, sqrt(I)] end) I getting following answer as
ans =
1.0e+02 *
0.100000000000000 1.000000000000000 0.031622776601684
But it should be as follows
ans =
10.0000 100.0000 3.1623
Is it something with my Matlab settings?
I use format long.

Accepted Answer

Star Strider
Star Strider on 9 May 2015
In MATLAB Preferences (the ‘gear’ icon in the top toolbar) you can set format to ‘short g’. You can also do so from the Command Window by simply typing:
format short g
That should give you the result you want, although no promises with matrices.
  2 Comments
Sergey Dukman
Sergey Dukman on 9 May 2015
Thank you Sir,
It works just fine!
Star Strider
Star Strider on 9 May 2015
My pleasure!

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!