Derivative function - MATLAB Cody - MATLAB Central

Problem 42588. Derivative function

Difficulty:Rate

Given a function handle f, generate a function that evaluates the derivative of f

Examples:

   f = @sin;
   df = Derivative(f);
   df([0 pi])
   ans =
        1    -1

Derivative of sin is cos, cos([0 pi]) = [1 -1]

Hint(Added 2015/9/17): https://en.wikipedia.org/wiki/Numerical_differentiation

Solution Stats

11.69% Correct | 88.31% Incorrect
Last Solution submitted on Jul 05, 2023

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers11

Suggested Problems

More from this Author8

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!