2017-05-08 78 views

回答

1

Check the data type对于v。我相信这是一个integer type,使用整数算术,这就是为什么结果是一个整数。您需要将其转换为floating point type才能对其执行浮点运算:

v = double(v);    % Convert v to a double-precision float 
x = ((v-mean(v))/std2(v)); % Result is now a double as well 
+0

知道了!非常感谢 –