2016年11月5日 星期六

[MATLAB] 微分後代值求解 (gradient, syms, eval)


Example:

function output = sigmoidalGradient(input)

    syms a;                                     % variable
    y = gradient(1/(1+exp(-a)));    % get gradient of the function
    a = input;                                 % let variable a be some number
    output = eval(y);                     % evaluate the funciton

end



沒有留言:

張貼留言