MATLAB Answers

how to solve system of equation using Gaussian Elimination or Gauss-Jordan

35 ビュー (過去 30 日間)
Ann Little
Ann Little 2019 年 12 月 4 日
回答済み: Sai Bhargav Avula 2019 年 12 月 6 日
How would I solve for x,y,z variables for this given system of equations using Gaussian elimination or Gauss-Jordan Elimination (which ever is easiest).
5x − 2y + 4z = 17
x + y + z = 9
4x − 3y + 3z = 8

  1 件のコメント

Muhammad Usman
Muhammad Usman 2019 年 12 月 4 日
I guess you are new to MATLAB, there are builtin function for Guass Jordon Elimination which you can look in the link:
under the section Solve System of Equations.
and for Guass Elimination you can look the answer asked before
I think it might help you alot.

サインイン to comment.

回答 (1 件)

Sai Bhargav Avula
Sai Bhargav Avula 2019 年 12 月 6 日
As Mr. Usaman mentioned you follow the given links to solve the system of equations.
I just wanted to add the simple code that might help you
A = [5 -2 4; 1 1 1; 4 -3 3];
B = [17 9 8]';
X = [A B];
R = rref(X)
R would be In Reduced Row echelon form which can further solved to solve for the variables.
But from numerical standpoint to solve for the x,y,z using R = A\B would be more efficient. This calculates the least square solution.
Hope this helps!

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。

Translated by