gradfun
function g = gradfun(fun,x)
% gradfun('fun',x) evaluates the gradient of the function 'fun' at the
% point x = [x1,..., xn]. This function uses complex differentiation.
%
% Example:
%
% f = @(x) 10*cos(x(1))*sin(x(2)) + x(1)^2 - 2*x(2)^2 + 10;
% x0 = [pi; -pi];
% g0 = gradfun(f, x0)
%
% Returns the value of the gradient of f at x0, which is [6.2832; 22.5664].
%
% Contact info:
%
% Andres Tovar
% tovara@iupui.edu
% Indiana University-Purdue University Indianapolis
Cite As
Andres Tovar (2024). gradfun (https://www.mathworks.com/matlabcentral/fileexchange/69994-gradfun), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |