Code covered by the BSD License  

Highlights from
Automatic Differentiation with Matlab Objects

Automatic Differentiation with Matlab Objects

by

 

01 Mar 2010 (Updated )

Automatically compute derivatives of functions, without using finite-difference approximations.

rosen(x)
function y = rosen(x)
% 
% Rosenbrock function
% Matlab Code by A. Hedar (Nov. 23, 2005).
% The number of variables n should be adjusted below.
% The default value of n = 2.
% 
sum = 0;
n=length(x);
for j = 1:n-1;
    sum = sum+100*(x(j)^2-x(j+1))^2+(x(j)-1)^2;
end
y = sum;

Contact us