Question: A pseudocode to solve the matrix equation ax = b is given below. Here, a is an n times n matrix and b is
A pseudocode to solve the matrix equation ax b is given below. Here, a is an n times n matrix and b is an n times vector. Write a Matlab script you must name it GaussEl.m that uses this pseudocode to find the vector x
Note: Your function will be tested for
a
b
Make sure that one gets the correct results when they execute the command
x GaussEl;; You do not need to discuss results or the code on your report; make sure enough comments are available in your script.
FUNCTION x GaussElab
n number of entries in vector b
DOFOR k n
DOFOR i k n factor aikakk DOFOR j k n
aij aij factor akj END DO
bi bi factor bk END DO
END DO
xn bnann
DOFOR i n
sum bi
DOFOR j in
sum sum aij xj END DO
xi sumaii END DO
END GaussEl
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
