X_norm = X; mu = zeros(1, size(X, 2)); sigma = zeros(1, size(X, 2)); for i = 1:2 mu(1,i) = mean(X,(:,i)); sigma(1,i) = std(X,0,(:,i)); col_mu = ones(size(X,1), 1) * mu(:,i) X_norm(:,i) = X(:,i) - col_mu X_norm(:,i) = X(:,i) * (1/sigma(1,i)) end end
I am trying to implement feature normalization as part of the Stanford Coursera ML Course. When I run this, I get an error message "invalid use of operator" for line 13, column 23.
The one that says (mu(1,i) = mean...
I was trying to make the i-th column of mu the mean of the i-th column of X. What am I doing wrong?