简体   繁体   English

强制八度显示仅科学计数法

[英]force Octave to show only scientific notation

See this code below, from Octave's Command Prompt: 请从Octave的命令提示符中查看以下代码:

>> log( 0.1 ) * 5e-8
 ans = -0.00000011513

As can be seen, there are quite a few zeros ( 6 to be exact). 可以看出,有很多零(准确地说是6)。 I would like if the number is displayed as 1.1513e-7. 我希望数字显示为1.1513e-7。 Or, scientific notation, by default. 或者,默认为科学计数法。 How does one do that? 怎么做到的?

You can change the format of the ouput displayed by octave with the function format , 您可以使用函数format更改以八度显示的输出format

eg format short e forces short length exponential notation, which seems that is what you want. 例如format short e强制使用短长度指数表示法,这似乎就是您想要的。

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

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