Answers:
这将计算标量,向量或矩阵的S形。
function g = sigmoid(z)
%   SIGMOID Compute sigmoid function
%   g = SIGMOID(z) computes the sigmoid of z.
% Compute the sigmoid of each value of z (z can be a matrix,
% vector or scalar).
SIGMOID = @(z) 1./(1 + exp(-z));
g = SIGMOID(z);
end
g = 1 ./ (1 + exp(-z));而不是SIGMOID在sigmoid函数内部创建它。