Solves a system of linear equations

Assignment Help Computer Engineering
Reference no: EM1384111

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.

Reference no: EM1384111

Questions Cloud

Theory of broken windows : Public disorganization policies as influenced by the Broken Windows theory seem to have been effective. Can you find evidence that either lends support to or further weakens the continued use of such policies?
How would you ensure that your limited sources : If you were CEO of Marriott, how would you ensure that your limited sources of capital were used strategically? In a recessionary economy, would you invest in existing property upkeep and improvement or would you build new hotels?
Homologous chromosomes in the cell during g1 : based on diploid cell that has 28 chromosomes in G1 of interphase, Discuss how many pairs of homologous chromosomes are in the cell during g1?
What are the culturally contingent leadership behaviors : What are the culturally contingent leadership behaviors and attributes? What are the positive leadership behaviors and traits that are universally accepted that facilitate leadership effectiveness?
Solves a system of linear equations : Write a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination.
Explain the historical relationships between risk : Explain the historical relationships between risk and return for common stocks versus corporate bonds.
Differential settlement between the centre line of the ring : Determine the differential settlement between the centre line of the ring beam and under the centre of beam. The inner and outer radii of the ring beam are 8m and 12m respectively.
What do you meant by a social problem : Critically discuss what is meant by a social problem and provide examples of social problems that could exist in a community. Select one social problem and describe where you could begin to make a difference locally.
Explain the process of financial planning used to estimate : Explain the process of financial planning used to estimate asset investment requirements for a corporation. Explain the concept of working capital management.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd