'X'在第17行第10列附近未定义

时间:2018-08-15 10:36:24

标签: octave

我正在尝试运行脚本“ featureNormalize”,但得到错误X未定义。但是,其他脚本正在运行,因此路径没有问题。

featureNormalize.m
error: 'X' undefined near line 17 column 10
error: called from
    featureNormalize at line 17 column 8

我的代码

function [X_norm, mu, sigma] = featureNormalize(X)

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

 mu = mean(X);
 sigma = std(X);
 m = size(X,1);

for i = 1:m
  X_norm(i,:) = X(i,:)-mu;
end;

for i = 1:m
   X_norm(i,:) = X(i,:)./sigma;
end;

0 个答案:

没有答案