Question
Create a function in MATLAB that finds the unique solution to Ax=b equation using Gaussian elimination with partial pivoting where A is a square matrix
Create a function in MATLAB that finds the unique solution to Ax=b equation using Gaussian elimination with partial pivoting where A is a square matrix and b is a column vector of the same height. The function will take A and b as inputs and give x as the output. Partial pivoting is choosing the largest absolute value possible for a diagonal entry within the active column and changing rows accordingly.
Part 1: Start by writing a function (with comments) to achieve these: Determine if the matrix A is square. Augment A and b. Find the maximum absolute value in the first column and the row number that this belongs to using a forloop. Interchange the first row with the row with the maximum firstcolumnentry. (To achieve this, create a short subfunction that interchanges two specified rows for any matrix.) Submit a single mfile with a subfunction that switches rows
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