Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination.  Your function should accept a matrix as an argument and return a matrix of the same dimension.

Note: Your function should be written to handle matrices of any size. Test your function with matrices of different sizes for which you know the solution to ensure that your function works correctly.

Use variable names that relate to their function and include comments that explain your program logic.

Do not use any built-in MATLAB functions except size(), input(), and zeros().

As example of what is expected from this function consider the following linear system:

3x + 2y + z = 11

2x + 3y +z = 13

x + y + 4z = 12

In this case you should pass into your function the following augmented matrix:

2341_calculates the inverse of a matrix by Gauss-Jordan elimination.png

After performing Gauss-Jordan elimination, your function should return the following reduced system:

1107_calculates the inverse of a matrix by Gauss-Jordan elimination1.png

from which we can readily determine that x = 1, y = 3, z = 2.

Furthermore, if you pass a double augmented matrix such as

1435_calculates the inverse of a matrix by Gauss-Jordan elimination2.png

Your function should return

441_calculates the inverse of a matrix by Gauss-Jordan elimination3.png

which solves the original equations

3x + 2y + z = 11

2x + 3y +z = 13

x + y + 4z = 12

as x = 1, y = 3, z = 2

and, at the same time, the equations

3x + 2y + z = -5

2x + 3y +z = -4

x + y + 4z = 9

as x = -2, y = -1, z = 3.

Additionally, if you pass to your function a square matrix on the left augmented by the identity matrix on the right, such as

705_calculates the inverse of a matrix by Gauss-Jordan elimination4.png

your function should return the identity matrix on the left and the inverse of the original square matrix on the right.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9741024

Have any Question?


Related Questions in Computer Engineering

Question suppose you are given a turing machine m not

Question : Suppose you are given a Turing machine M (not necessarily a decider), a string w, and a magic genie. You can ask the magic genie whether a certain Turing machine halts on a certain input string, and the genie ...

Can someone help me answer these questions these are from

Can someone help me answer these questions? These are from Android Studio that you need answered for class. (1) What is "Minimum SDK" meaning in program? (2) Can "Wear Minimum SDK" API version be smaller than that of "Ph ...

Question nested lists and cascading style sheetsdeliverable

Question: Nested Lists and Cascading Style Sheets Deliverable: Three (3) Web pages and two (2) Cascading Style Sheets (.css) Complete the weekly lab based on the following: • Write the code for each lab assignment. • The ...

What is the lithium by mass in a sample of pure lithium

What is the % lithium by mass in a sample of pure lithium carbonate that has a sample size of 10.0g?

Would be being proposed transfer scheme answer the problems

Would be being proposed transfer scheme answer the problem/s seen in the implementation of the TRAIN law? Explain why or why not in light of the ongoing 4Ps etc. What are some other tax reform in Collas-Monsod's wish lis ...

In some states allow requires drivers to turn on their

In some states allow requires drivers to turn on their headlights when driving in the rain. A highway patrol officer believes that lesson one-quarter of all the drivers follow this rule. As a test, he randomly samples 20 ...

Naomi always eats bagels with 1 ounce of cream cheese each

Naomi always eats bagels with 1 ounce of cream cheese. Each bagel eaten in this way provide 15 units of utility. Excess cream cheese or excess bagels do not add to Naomi's utility. Explain the nature of Naomi's utility f ...

Question suppose you have two arrays of 8-bit signed

Question : Suppose you have two arrays of 8-bit signed integers P[i] and Q[i] for 0 = i A pointer to the array P is passed in register X and a pointer to the array Q is passed in register Y. The number of elements in eac ...

Smart invest is a small sized investment group that caters

"Smart Invest" is a small sized investment group that caters variety of services to their clients, services such as: financial advising, 401K planing, long term and short term stocks and bonds investment and many others. ...

Question suppose you work for a company ipuritancom that

Question : Suppose you work for a company, iPuritan.com, that has strict rules for when two employees, x and y, may date one another, requiring approval from their lowest-level common supervisor. The employees at iPurita ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As