Skip to content

Instantly share code, notes, and snippets.

Created Jul 30, 2012
What would you like to do?
Sigmoid function
function g = sigmoid(z)
%SIGMOID Compute sigmoid functoon
% J = SIGMOID(z) computes the sigmoid of z.
g = arrayfun( @(x) 1 / (1 + e^(-x)), z);
% =============================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment