Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ x ] = Newton(x0, f, fd, N, eps, maxiter)
- maxval = maxiter;
- x1 = x0;
- for i=N:-1:0
- xn = xx - f(x1) /fd(x1);
- if abs(f(xn)) < eps
- x = xn;
- iter = 100 - N;
- return
- endif
- if abs(f(x1)) > maxval
- disp("Nu converge!");
- break;
- endif
- x1 = xn;
- endwhile
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment