Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 18 lines (12 sloc) 0.51 kb
0a30548 @kamu added exercise 7. A bit late, but what ever.
authored
1 function [X_norm, mu, sigma] = featureNormalize(X)
2 %FEATURENORMALIZE Normalizes the features in X
3 % FEATURENORMALIZE(X) returns a normalized version of X where
4 % the mean value of each feature is 0 and the standard deviation
5 % is 1. This is often a good preprocessing step to do when
6 % working with learning algorithms.
7
8 mu = mean(X);
9 X_norm = bsxfun(@minus, X, mu);
10
11 sigma = std(X_norm);
12 X_norm = bsxfun(@rdivide, X_norm, sigma);
13
14
15 % ============================================================
16
17 end
Something went wrong with that request. Please try again.