Home /
Expert Answers /
Advanced Math /
implement-using-matlab-purpose-to-solve-ax-b-given-an-initial-approximation-x-0-input-the-numbe-pa808
(Solved): implement using matlab Purpose: To solve Ax=b, given an initial approximation x(0). INPUT: The numbe ...
implement using matlab
Purpose: To solve Ax=b, given an initial approximation x(0). INPUT: The number of equations and unknowns n; the matrix (A)ij?=aij?, the entries bi?, the entries of XO=x(0), for 1?i,j?n; the error tolerance TOL; the maximum number of iterations N. OUTPUT: The approximate solution x1?,…,xn? or a message that the number of iterations was exceeded. Step 1. Set k=1 Step 2. While k?N do Steps 3-6. Step 3. For i=1,…,n Set xi?=(bj???j=1j?1?aj?xj???j=i+1n?aij?XOj?)/aij? Step 4. If ?x?XO?<TOL, then OUTPUT x1?,…,xn?. STOP Step 5. Set k=k+1 Step 6. For i=1,…,n set XOi?=xi?. Step 7. OUTPUT('Max number of iterations exceeded'). STOP