% eda_sigma
% plot sigma(x) = (1+exp(-wx))^-1
% for a variety of w's.  Note that
% dsigma/dx = w exp(-w) (1+exp(-wx))^-2
% so the slope at x=0 is s=w/4
clear all;

s = [100, 3, 1, 0.1]'; %slopes
Ns = length(s);

% standard x axis setup
Nx = 501;
xmin = -2;
xmax = 2;
x = xmin + (xmax-xmin)*[0:Nx-1]'/(Nx-1);

figure(1);
clf;

for i = [1:Ns]
    w=4*s(i);
    sigma = (1+exp(-w*x)).^(-1);
    subplot( Ns, 1, i );
    set(gca,'LineWidth',2);
    hold on;
    axis([xmin,xmax,-1.5,1.5]);
    plot(x,sigma,'k-','LineWidth',3);
    xlabel('x');
    ylabel('sigma(x)');
end