See https://github.com/tamaskis/differentiate-MATLAB or “DOCUMENTATION.pdf” for additional documentation and examples. Examples can also be found in “EXAMPLES.m”.
The “differentiate” function finds derivative of a univariate function f(x) over a domain or at a specified point (or set of points). f(x) itself can be supplied either as a function handle, or as two vectors (with one storing values of the independent variable and the other storing the corresponding function evaluations).
There is an existing MATLAB function called “differentiate” in the Curve Fitting Toolbox. That function can differentiate (including finding gradients of multivariate functions) cfit and sfit objects, which are fits to data. This function, on the other hand, differentiates univariate functions that are either input as vectors (similar to how vectors are used in trapz and cumtrapz) or as a function handle.
Tamas Kis (2021). Numerical Differentiation (differentiate) (https://github.com/tamaskis/differentiate-MATLAB/releases/tag/v1.0.2), GitHub. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!