Question: Need Help with Matlab code please follow direction and comment on the code Write a function called gauss_seidel that inputs an n x n matrix,
Need Help with Matlab code please follow direction and comment on the code

Write a function called gauss_seidel that inputs an n x n matrix, A, a column vector, b, an initial guess x(, an error tolerance e, and a maximum number of iterations, and output an approximate solution obtained using the Gauss-Seidel method, the error and the number of iterations. The header should look like [x, err, Ngauss_seidel (A, b, x0, tol, Nmax). Use the method to find approximate solutions to the linear system 2 1 0 0 01 2 10-2 0 02 0 2-4 0 0 3 7 -8 to within an accuracy of 105, with a maximum of N 100 iterations. If your method succeeds, report the number of iterations needed. If your method fails, offer a possible reason why. Hint: to validate your approach, compare your solution with the one obtained by doing A\b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
