转换数字格式

时间:2012-07-13 03:56:46

标签: matlab formatting

我对Matlab产生的数字有所了解。 这是什么意思?我怎样才能将这些数字转换为int? 这是矩阵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 个答案:

答案 0 :(得分:4)

1.0e+004表示1.0*10^4

使用int32(x)进行转换工作,根据您的目标精度,您也可以使用int16(x)或int64(x)。查看文档http://www.mathworks.de/help/techdoc/ref/int32.html

舍入也已完成。