Converting Number format

拈花ヽ惹草 提交于 2019-12-12 02:13:14

问题


I have problem understanding the numbers produced by Matlab. What does the e mean? And how can i convert those numbers to int? This is the answer for a matrix x=[x1, x2,x3,x4,x5,x6,x7,x8]

ans =

  1.0e+004 *

   -0.0000
   -0.6340
   -0.3660
   -0.8966
    0.6340
    1.0000
   -0.7321
    0.6340

回答1:


The 1.0e+004 means 1.0*10^4.

Casting works using int32(x), depending on your target accuracy you can also use int16(x) or int64(x). Check out the documentation http://www.mathworks.de/help/techdoc/ref/int32.html

Rounding is also done.



来源:https://stackoverflow.com/questions/11463907/converting-number-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!