main.m643 chars23 lines
The above code defines a calc_derivatives
function that takes in the handles for the given function, f, its first derivative (f'), and second derivative (f'') as well as the value x, at which the derivatives are to be evaluated.
The function computes the values of the discussed derivatives and returns these values as three separate outputs: f_val, f_prime, and f_double_prime.
gistlibby LogSnag