⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seidel.m

📁 数值计算方法的教程
💻 M
字号:
function [P,iter]= seidel(G,P,delta, max1)%Input    -  G is the nonlinear fixed-point system %               saved as an M-file function%            -  P is the initial guess at the solution %            -  delta is the error bound%            - max1 is the number of iterations%Output - P is the seidel approximation to the solution%     	     - iter is the number of iterations required%Use the @ notation call [P,iter]=seidel(@G, P, delta, ma).%  NUMERICAL METHODS: Matlab Programs% (c) 2004 by John H. Mathews and Kurtis D. Fink%  Complementary Software to accompany the textbook:%  NUMERICAL METHODS: Using Matlab, Fourth Edition%  ISBN: 0-13-065248-2%  Prentice-Hall Pub. Inc.%  One Lake Street%  Upper Saddle River, NJ 07458N=length(P);for k=1:max1   X=P;      % X is the kth approximation to the solution   for j=1:N           A=G(X);      % Update the terms of X as they are calculated      X(j)=A(j);        end   err=abs(norm(X-P));   relerr=err/(norm(X)+eps);   P=X;   iter=k;   if (err<delta)|(relerr<delta)     break   endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -