function J = JacDF(F,x0) % Approximation of the Jacobian of the % vectorial function F in x0 by means of % forward finite differences (DF) % F is the function to be differentiated % (column vector) % x0 evaluation point (column vector) delta = sqrt(eps); % passo per le DF n = length(x0); J = zeros(n,n); I = eye(n,n); for j = 1:n J(:,j) = (F(x0+delta*I(:,j))-F(x0))/delta; end end