Hello, I this is my Newton's Method, but I do not know what changes to make to be able to find the root of a system of equations f(x) = 0.
My inputs must be able to accept funtion handles for f, an the Jacobian K, initial vector x0 and my output should be the approximate root xn.
What do I have to do to make my newtons method be able to to find the root of a system of equations?
function xn = newtonsMethod(f, fprime, x0, tol)
maxiter = 50;
rn = abs(f(x0));
xn = x0;
n = 0;
while rn > tol && n < maxiter
n = n+1;
xn = xn - f(xn) ./ fprime(xn);
rn = abs(f(xn));
if n == maxiter
warning('Maximum number of iterations reached');