问题
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