Next: , Previous: , Up: Gradient functions   [Index]


4.2 Higher order numerical derivatives

Function File: dx = deriv (f, x0)
Function File: dx = deriv (f, x0, h)
Function File: dx = deriv (f, x0, h, O)
Function File: dx = deriv (f, x0, h, O, N)

Calculate derivate of function f.

f must be a function handle or the name of a function that takes x0 and returns a variable of equal length and orientation. x0 must be a numeric vector or scalar.

h defines the step taken for the derivative calculation. Defaults to 1e-7.

O defines the order of the calculation. Supported values are 2 (h^2 order) or 4 (h^4 order). Defaults to 2.

N defines the derivative order. Defaults to the 1st derivative of the function. Can be up to the 4th derivative.

Reference: Numerical Methods for Mathematics, Science, and Engineering by John H. Mathews.