Question: Write this code using Matlab Jacobi Iterative Method. Purpose: To solve Ax - b, given an initial approximation x. INPUT: The number of equations and
Write this code using Matlab
Jacobi Iterative Method. Purpose: To solve Ax - b, given an initial approximation x. INPUT: The number of equations and unknowns n; the matrix (A) - ay, the entries b, the entries of XO = x(0), for l s n; the error tolerance TOL; the maximum number of iterations N. OUTPUT: The approximate solution x,,. ..,x, or a message that the number of iterations was exceeded. Step 1. Set k-1 Step 2. While ks N do Steps 3-6. Step 3. For i-1,...,n j-1 ?1 ji Step 4. If II x-XO lk TOL , then OUTPUT Xi, Step 5. Set k=k+1 Step 6. For i1,., setXO, -x , xn. STOP Step 7. OUTPUT('Max number of iterations exceeded"). STOP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
