When a nonsymmetric matrix is well conditioned and it is feasible to computethencan be applied to the normal equations.
Write a MATLAB function [x r iter] = normalsolve(A,b,x0,tol,numiter) that uses the normal equation approach to solving
The MATLAB command R = sprandn(m,n,density,rc) generates a random sparse matrix of sizewhere density is the fraction of nonzeros and the reciprocal of rc is the approximate condition number. Generaterandomly, and set x0 = ones(size,1). Using an error tolerance of−10and maximum number of iterations set tocompute the residual and number of iterations required by normalsolve for each sparse system.
i.R1 = sprandn
ii.R2 = sprandn
iii.R3 = sprandn
Add the normal equation approach to the appropriate locations in
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here