简体   繁体   English

用Matlab避免科学计数法

[英]Avoiding scientific notation with Matlab

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 ? 不使用fprintf类的方法如何避免科学计数法?

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: 或更复杂的选择是使用基于Java的格式( 请参阅更多信息 ,感谢Yair Altman展示此方法),例如:

char(java.text.DecimalFormat('#.00000000').format(yourNumber));

转到:首选项>命令视图>数字格式> bank

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM