How to normalize data ?

1 回表示 (過去 30 日間)
Oman Wisni
Oman Wisni 2018 年 12 月 16 日
コメント済み: Oman Wisni 2018 年 12 月 16 日
Hi, I have data with dimension 1x25, where
x = rand(1,25);
D = size(x,2);
I'm trying using this code, but the result is NaN. Please help me, to fix my code. Thanks
for col = 1: D
x(:,col)=double(x(:,col)-mean(x(:,col)));
end
for col = 1: D
x(:,col)=double(x(:,col)/std(x(:,col)));
end

採用された回答

Stephan
Stephan 2018 年 12 月 16 日
x = rand(1,25);
x = (x-mean(x))/std(x)
  3 件のコメント
Stephan
Stephan 2018 年 12 月 16 日
編集済み: Stephan 2018 年 12 月 16 日
Which Matlab release do you use? In 2018b the result is a 220x1 vector.
Oman Wisni
Oman Wisni 2018 年 12 月 16 日
I used matlab R2015a

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by