Question: using Matlab please Problem 1 Solve, using a MATLAB code, the following system: 5x y +z + w = 9 2 + 7y + 2x
Problem 1 Solve, using a MATLAB code, the following system: 5x y +z + w = 9 2 + 7y + 2x + 2w = 3 2x + y + 5z + w = 7 -y +z + 4w = 6 Use the Jacobi method with a tolerance of 10-5 for the norm of the residual. Arrange your results in a table of the form X y z w iteration 0 0 0 0 0 1 .. so that you can see how x, y, z and w change with each iteration. You can create such a table using disp() in a loop; you may also use variants of printf, i.e. fprintf or sprintf if you are familiar with these functions, but do not use the Matlab table command as it does not do quite what is expected here. Also, as obvious from the table above, start with the zero guess. Moreover, plot the norm of the residual versus the iteration number; use a logarithmic scale on the vertical axis (the residual axis). Turn in your code and the output as described. The code can be organized as: (a) a function file that implements Jacobi's method; and (b) a script that calls the function with the appropriate inputs and processes the results. Your plot should have a plot title, axes labels and a legend. Use the help plot command and the class notes to investigate the various options available when plotting
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
