Réponse acceptée

li haitao
li haitao le 7 Juin 2014
Modifié(e) : li haitao le 7 Juin 2014

2 votes

Give you an exmaple:
>> load('lawdata.mat')
>> [Z,gpamean,gpastdev] = zscore(gpa);
>> gpa2=Z*gpastdev+gpamean;
>> gpa2-gpa
ans =
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
So gpa2 is the same with gpa.

1 commentaire

pietro
pietro le 7 Juin 2014
Thanks to all, I supposed there was an embedded function I wanted to use to improve the code readability.

Connectez-vous pour commenter.

Plus de réponses (1)

Star Strider
Star Strider le 7 Juin 2014

5 votes

To get x from Z knowing the mean (mu) and standard deviation (s):
x = Z*s + mu

Community Treasure Hunt

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

Start Hunting!

Translated by