%Script file for Exam 1. Save this file as exam1matrixA.m %Run exam1matrixA to obtain the matrix A and vector b % then use Jacobi iteration to solve Ax=b so that the % estimated b is within 10^-6 of the real b. % Save your solution in x by typing: save exam1x x %Then email me your script and exam1x.mat A=zeros(80,80); for i=1:80 for j=1:80 if j==i A(i,j)=2*i; elseif j==i+2 & i<=78 A(i,j)=0.5*i; elseif j==i-2 & i>=3 A(i,j)=0.5*i; elseif j==i+4 & i<=76 A(i,j)=0.25*i; elseif j==i-4 & i>=5 A(i,j)=0.25*i; end end end b=pi*ones(80,1); clear i j