Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help with matlab Next, you will use these row operations to write a function that performs Gauss- Jordan elimination and compute the reduced row echelon
help with matlab
Next, you will use these row operations to write a function that performs Gauss- Jordan elimination and compute the reduced row echelon form of any matrix. We will call the function my rref, because the rref function already exists in MATLAB Specification: function R = my rref (A) Input: a rectangular matrix A. Output: the reduced row echelon form of A. For full credit, your function should handle the following: Partial pivoting: At each step, you should swap the current row with the one whose entry in the pivot column has the largest absolute value. Free variables: Due to numerical error, the entries in a column corre- sponding to a free variable may be extremely small but not precisely zero. Therefore, you should consider an entry to be zero if its absolute value is smaller than 10-12 We suggest first implementing the algorithm without considering these two issues, then adding code to deal with them one at a time. Implementation tips: There are two different ways one can implement Gauss-Jordan elimination. In Section 1.2 under "The Row Reduction Algorithm", the book describes it in two phases: first do Gaussian elimination (Steps 1-4), then perform row operations equivalent to back-substitution (Step 5). Gauss-Jordan elimination can also be done in a single phase: every time you find a pivot, perform scaling so the pivot entry becomes 1, then perform elimination on all the other rows, both above and below the pivot row. You may use either approach in your implementation. Below, we provide pseudocode for the latter approach. In either case, since we want to be able to handle free variables, the pivot 0 . 0 . entry won't necessarily be on the di- 0 . 0 agonal. Instead, you'll need to keep 000. track of both the pivot row, say k, and k 0 0 0 0 0 1 0 0 0 0 the pivot column, l, as you go along; see the illustration on the right. i 0 0 0 0 Algorithm 1 RRER 1: initialize pivot row k = 1, pivot column 1 = 1 2. while I SkSm and I 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