Algebra: Linear Equations

2 ビュー (過去 30 日間)
Wai Han
Wai Han 2020 年 10 月 25 日
コメント済み: Ameer Hamza 2020 年 10 月 25 日
How can I solve this linear systems without using Symbolic toolbox?
a*x + b*y = c1
c*x + d*y + e*z = c2
f*y + g*z = c3
% where a,b,c,d,e,f,g and c1,c2,c3 are constants.
% I need to solve this for Kirchhoff's first law without the symbolic math toolbox.
Thank you so much.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 25 日
If the value of these constants are known, then you can use mldivide: https://www.mathworks.com/help/matlab/ref/mldivide.html
a = 1;
b = 2;
c = 1.4;
d = 1.2;
e = 2.1;
f = 3.2;
g = 1.1;
c1 = 1;
c2 = 2;
c3 = 3;
A = [a b 0;
c d e;
0 f g];
B = [c1; c2; c3];
sol = A\B;
x = sol(1);
y = sol(2);
z = sol(3);
  2 件のコメント
Wai Han
Wai Han 2020 年 10 月 25 日
Thanks Ameer Hamza.
Ameer Hamza
Ameer Hamza 2020 年 10 月 25 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by