Clear Filters
Clear Filters

Normalize function of matlab

4 views (last 30 days)
AMIR KHAN
AMIR KHAN on 4 Sep 2021
Commented: AMIR KHAN on 4 Sep 2021
I am trying to normalize my data and using matlab's normalize() function. I want the normalized data, center and scalar values as the output. But when I am simulating it is saying "too many output arguments." But I have seen from the page https://uk.mathworks.com/help/matlab/ref/double.normalize.html and using the same way. Kindly, see the screenshot.
  1 Comment
AMIR KHAN
AMIR KHAN on 4 Sep 2021
Thanks a lot. I want to normalize the test set from same mean and std as that of train set. Is there any function for that?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 4 Sep 2021
In your release, only the one-output form of normalize() was available.
The three-output form is new as of R2021a.
  3 Comments
Walter Roberson
Walter Roberson on 4 Sep 2021
c = mean(Xs);
s = std(Xs);
Xs = normalize((Xs-c) ./ s);
and then use the same s and c for all other datasets you want to center and scale the same way.

Sign in to comment.

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!