How to round double to something that a 'normal' human can read. (MATLAB)

前端 未结 1 600
[愿得一人]
[愿得一人] 2020-12-12 07:30

My MATLAB code is giving me following double answer: 1.727287951101063e+04. I know its about 0, but how can I round/convert it into a better readab

相关标签:
1条回答
  • 2020-12-12 08:05

    Use format long g:

    >> A = 1.727287951101063e+04;
    >> format long g;
    >> A
    
    A =
    
              17272.8795110106
    

    You can check out the docs on how format works: http://www.mathworks.com/help/matlab/ref/format.html. However, format long g essentially represents your number with 15 digits, fitting all of the digits that make the significant part of your number (without the decimal place), and filling in the rest of the spots with the decimal numbers (those that follow after the decimal place).

    0 讨论(0)
提交回复
热议问题