Problem 2892. Deriving a function using the difference quotient
Write a function that evaluates the derivative of a function in a given point using the well-know formula of the difference quotient:
f'(x)=(f(x+h)- f(x -h))/(2*h)
Example:
input: @sin,pi/4,1e-4 output: 0.7071
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers66
Suggested Problems
-
Select every other element of a vector
30235 Solvers
-
1579 Solvers
-
Convert a numerical matrix into a cell array of strings
1473 Solvers
-
427 Solvers
-
352 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!