how can i solve the problem? Submission failed: 'mean' undefined near line 29, column 6

Viewed 28

I have a problem with week 2 programming assignment in the machine learning course in Coursera the problem (Submission failed: 'mean' undefined near line 29, column 6) in this code anyone has a solution, please

function [X_norm, mu, sigma] = featureNormalize(X)
  %description: Normalizes the features in X
  %   FEATURENORMALIZE(X) returns a normalized version of X where
  %   the mean value of each feature is 0 and the standard deviation
  %   is 1. This is often a good preprocessing step to do when
  %   working with learning algorithms.

  X_norm = X;
  mu = zeros(1, size(X, 2));
  sigma = zeros(1, size(X, 2));

  % Instructions: First, for each feature dimension, compute the mean
  %               of the feature and subtract it from the dataset,
  %               storing the mean value in mu. Next, compute the
  %               standard deviation of each feature and divide
  %               each feature by it's standard deviation, storing
  %               the standard deviation in sigma.
  %
  %               Note that X is a matrix where each column is a
  %               feature and each row is an example. You need
  %               to perform the normalization separately for
  %               each feature.

  mu = mean(X);
  sigma = std(X);
  X_norm = (X - mu)./sigma;
end
0 Answers
Related