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

📄 gaussseidel.m

📁 matlab程序
💻 M
字号:
function x=GaussSeidel(A,b,x,N)
temp1=0;
temp2=0;
temp3=0;
temp4=0; 
for k=1:N
   for j=2:4
      temp1=temp1+A(1,j)*x(j);
   end
     x(1)=(b(1)-temp1)/A(1,1);
     temp1=0;
   for j=3:4
       temp2=temp2+A(2,j)*x(j);
   end
      x(2)=(b(2)-A(2,1)*x(1)-temp2)/A(2,2);
      temp2=0;
   for j=1:2
       temp3=temp3+A(3,j)*x(j);
   end
       x(3)=(b(3)-temp3-A(3,4)*x(4))/A(3,3);
       temp3=0;
   for j=1:3
       temp4=temp4+A(4,j)*x(j);
   end
       x(4)=(b(4)-temp4)/A(4,4);
       temp4=0;
end

⌨️ 快捷键说明

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