I changed a little bit my code:
%%file newton2d.m
function [out] = newton2d(x, y, f, Jf, eps)
k = 0;
h = Jf(x,y)\f(x,y)';
while abs(h)>=eps && k<1000
h = Jf(x,y)\f(x,y)'; %% error
[x,y] = [x,y]- h';
k = k+1;
end
out = [x,y];
end
Why it's still not working?
Then I create a vector function with it's Jacobian:
%%file f4.m
function out = f4(x,y)
out = [(x^3)-(3*x*(y^2))-1 , (3*(x^2)*y)-(y^3)]
end
%%file Jf4.m
function out = Jf4(x,y)
out = jacobian(f, [x, y]);
end
How to call f4 in my jacobian function?
newton2d(1,2,@f4, @Jf4, 10^(-8))
it's not working when I call my functions...
Thank you for your help !