📄 newtonsys.m
字号:
function [x,k] = newtonsys(fdf,x0,tol,kmax)
% Solve system f(x)=0 by Newton-Raphson's method.
% f(x) and J(x) given by [f,J] = fdf(x)
% Starting point x0.
% Iterate until norm of correction is smaller than tol
% or the number of steps exceeds kmax
% Version 11.12.2003. INCBOX
k = 0; x = x0; % initialize
[f, J] = feval(fdf, x); h = J\f;
while (norm(h) > tol) & (k < kmax)
k = k+1; x = x - h;
[f, J] = feval(fdf, x); h = J\f;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -