Avoiding scientific notation with Matlab

2019-02-10 20:24发布

I have altready tried:

format long g;

But a number like this shows with scientific notation:

ans = 8.80173259769825e-05

How can I avoid scientific notation without using something like fprintf ?

2条回答
时光不老,我们不散
2楼-- · 2019-02-10 21:13

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

查看更多
趁早两清
3楼-- · 2019-02-10 21:16

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));
查看更多
登录 后发表回答