1function [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 8mu = mean(X); 9X_norm = bsxfun(@minus, X, mu); 10 11sigma = std(X_norm); 12X_norm = bsxfun(@rdivide, X_norm, sigma); 13 14 15% ============================================================ 16 17end 18 19