Gauss elimination
Version 1.0.1 (1.22 KB) by
Langel Thangmawia
Solution of system of equation by Gauss elimination
Solution of system of equation by Gauss elimination
In order to apply Gauss elimination method, we need to express linear equations in matrix form AX=B, where A is called Coefficient matrix and B Right hand side vector.
Arrange matrices A and B in augmented matrix.
Now, use elementary row operations to reduced to upper traingular form.
Exchanging or swapping two rows
Adding the certain multiple of one row to another row
Multiplying a row by non-zero number
This procedure is repeated until the augmented matrix is reduced to upper triangular form
Now by back substitution the values of the variables can be found.
Example : By Gauss Elimination method, solve
x + y + z = 9
2x - 3y + 4z = 13
3x + 4y + 5z = 40
Enter matrix A : [1,1,1;2,-3,4;3,4,5]
A =
1 1 1
2 -3 4
3 4 5
Enter rhs vector B : [9;13;40]
1.0000 1.0000 1.0000 9.0000
0 -5.0000 2.0000 -5.0000
0 0 2.4000 12.0000
Solution =
1
3
5
Cite As
Langel Thangmawia (2025). Gauss elimination (https://www.mathworks.com/matlabcentral/fileexchange/180726-gauss-elimination), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2024b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.