Question
For matrix A, apply the following methods in the matlab program. Please share the screenshot of the editor and command screens. A=[20514 4424 978 224;4424
For matrix A, apply the following methods in the matlab program. Please share the screenshot of the editor and command screens.
A=[20514 4424 978 224;4424 978 224 54; 978 224 54 14;224 54 14 4];
b = sum(A,2); tol = 1e-6; % relatiev tolerance for convergenve for iterative method maxit = 100; % max number of iterations for iterative methods
% Preconditioned conjugate gradients method. This method is appropriate % for Hermitian positive definite coefficient matrix A x1 = pcg(A,b,tol,maxit); fprintf('Using Preconditioned conjugate gradients method, a solution is obtained as '); disp(x1')
% BiConjugate Gradients Method x2 = bicg(A,b,tol,maxit); fprintf('Using BiConjugate Gradients Method, a solution is obtained as '); disp(x2')
% Conjugate Gradients Squared Method x6= cgs(A,b,tol,maxit); fprintf('Using Conjugate Gradients Squared Method, a solution is obtained as '); disp(x6')
%Biconjugate Gradients Stabilized Method x4= bicgstab(A,b,tol,maxit); fprintf('Using Biconjugate Gradients Stabilized Method,a solution is obtained as '); disp(x4')
%Minimum Residual Method x5= minres(A,b,tol,maxit); fprintf('Using Minimum Residual Method ,a solution is obtained as '); disp(x5')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started