Avoiding scientific notation with Matlab

前端 未结 2 366
名媛妹妹
名媛妹妹 2021-01-03 07:24

I have altready tried:

format long g;

But a number like this shows with scientific notation:

ans = 8.80173259769825e-05


        
相关标签:
2条回答
  • 2021-01-03 08:05

    you can use:

    sprintf('%.10f', yourNumber)
    

    Or a more sophisticated option is to use Java-based formatting (see more info , credit to Yair Altman for showing this method), for example:

    char(java.text.DecimalFormat('#.00000000').format(yourNumber));
    
    0 讨论(0)
  • 2021-01-03 08:05

    Go to: Preferences > Command view > Numeric Format > bank

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