Solves a linear system of simultaneous equations

Solves a linear system of simultaneous equations of n unknowns in n equations
429 Downloads
Aktualisiert 8. Apr 2010

Lizenz anzeigen

simequation(a,b)
a must be a n x n matrix of coefficients and
b must be a n x 1 matrix of constants

Example usage to solve this system of 2 simultaneous linear equations in 2 unknowns:

2x + 4x = 3 and
3x + 5x = 6

%coefficient matrix..
>> cm = [ 2 , 4; 3, 5]
cm =
2 4
3 5
>>

%..calling the function to solve the simultaneous linear equations...pass the constants as a column vector.
>> simequation(cm,[3;6])

ans =

4.5000
-1.5000

% check answer
>> cm * ans

ans =

3.0000
6.0000

>>

Zitieren als

Bruce Raine (2024). Solves a linear system of simultaneous equations (https://www.mathworks.com/matlabcentral/fileexchange/27207-solves-a-linear-system-of-simultaneous-equations), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2010a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0