sigmoid.m 435 B

123456789101112131415161718
  1. function g = sigmoid(z)
  2. %SIGMOID Compute sigmoid function
  3. % g = SIGMOID(z) computes the sigmoid of z.
  4. % You need to return the following variables correctly
  5. g = 1 ./ ( exp(-z) + 1 );
  6. % ====================== YOUR CODE HERE ======================
  7. % Instructions: Compute the sigmoid of each value of z (z can be a matrix,
  8. % vector or scalar).
  9. % =============================================================
  10. end