2017-05-08 145 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

知道了!非常感謝 –