Question: Create a function in a file that begins with: function [q,r) = hreflections (2) format [m, ni =size (A) ; IFeye (m) ; CFave (m)

Create a function in a file that begins with: function [q,r) = hreflections (2) format [m, ni =size (A) ; IFeye (m) ; CFave (m) ; =min (m, n) ; The matrices , and , were described in the Algorithm. The matrix Q, which is initialized as (=eye (m) , is the one that will be computed by the formula (3), expanded to the size of an m *m matrix, and then used to modify the matrix r. Continue your function with a "for" loop that will run through the columns of the matrix r from 1 to k (=1 : k) . **First, place the command below that generates the submatrices: R=x (1 : end, i : end) ; **Next, check if the first column of : is a zero vector. If it is the case, pass the control to the next iteration skipping all remaining commands in the body of the "for" loop - a MATLAB command continue can be used here. If the first column of : is a non-zero vector, follow the Description of the Algorithm and, first, output the identity matrix :, whose size is adjusted to the iteration (for a =1 matrix Iseye (m) and then the size of its rows/columns drops by 1 with each iteration), and, next output: zolnorm=norm (R(: , 1) ) ; u=R ( :, 1) -colnorm*I (: , 1) ; u=closetozeroroundoff (u, 7) ; If the output u is a zero vector, pass the control to the next iteration of i. If u is a non-zero vector, output the vector v and the matrix @ according to the formulas (2) and (3). Then, embed the matrix @ into the size m x m identity matrix as described in the Algorithm and assign the resulting matrix to @ again. Note: to check if a vector is a zero vector, you can use the command ~any ( ) . **Next, place the commands below that output consecutive iterations for y and q according to the formulas (1) and (4) (remember that / and q were initialized as r=x and gzeye (m) ): r=closetozeroroundoff (x , 7) ; This is the end of the "for" loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
