Question: 4 . 2 4 Write a user - defined MATLAB function that determines the inverse of a matrix using the Gauss - Jor - dan
Write a userdefined MATLAB function that determines the inverse of a matrix using the GaussJor
dan method. For the function name and arguments use Ainv Inverse A where A is the matrix to be
inverted, and Ainv is the inverse of the matrix. Use the Inverse function to calculate the inverse of:
a The matrix
b The matrix
Hint: in your code, construct a matrix, where is the input square matrix and is the identity matrix. In order to perform GaussJordan
on you need to use row operations on such that the columns corresponding to A become the identity matrix, and the columns holding
will be the inverse.
Note: No need of pivoting for this code.
import numpy as np
def InverseA:
return
#Output
#Answer for a
#Answer for b
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
