How to normalize data ?

4 Ansichten (letzte 30 Tage)
Oman Wisni
Oman Wisni am 16 Dez. 2018
Kommentiert: Oman Wisni am 16 Dez. 2018
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

Akzeptierte Antwort

Stephan
Stephan am 16 Dez. 2018
x = rand(1,25);
x = (x-mean(x))/std(x)
  3 Kommentare
Stephan
Stephan am 16 Dez. 2018
Bearbeitet: Stephan am 16 Dez. 2018
Which Matlab release do you use? In 2018b the result is a 220x1 vector.
Oman Wisni
Oman Wisni am 16 Dez. 2018
I used matlab R2015a

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by