Gauss solver for linear system of the equations
call [C,D,rank]=fundam(A_num,A_den) see Execute.m for examples.
A_num, A_den - two matrices which set the coefficients (numerators,denominators) of the linear equation system.
For example
1/2*x1-2/3*x2=5/4
3/4*x1+5/7*x2=2/1
A_num=[1 -2 5; 3 5 2]
A_den=[2 3 4;4 7 1]
there are 3 category of results:
1) System is inconsystent
2) System is consistent and has еру only one common solution
3) System is consystent and has a lot of solutions
The output of the solver are the matrices of the coeficients C,D - have the same logic (numerators and denominators) of each coefficient near Xn.
for 2) category (one common solution) C always has diagonal form
For example:
Numerators
C= [1 0 3;
0 1 2]
Denominators
D=[1 1 1;
1 1 5]
means
X1 =3
X2=2/5
for 3) category matrices C,D represents the fundamental solution for the system
for example
Numerators
C= [1 2 3]
Denominators
D=[1 1 7;]
should be accounted as fundamental solution:
1*X1+2*X2=3/7
-----
rank is rank ;)
Cite As
Oleksiy Kuts (2024). Gauss solver for linear system of the equations (https://www.mathworks.com/matlabcentral/fileexchange/50122-gauss-solver-for-linear-system-of-the-equations), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
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.