how to solve a simultaneous equation of 2 variables.
118 ビュー (過去 30 日間)
古いコメントを表示
Sivakumaran Chandrasekaran
2013 年 3 月 30 日
回答済み: SHREY VERMA
2021 年 8 月 26 日
x+3y=5;2x+4y=4. In general maths, we can be able to find the values of 'x' and 'y' from the above equations. How to find it in MATLAB?
0 件のコメント
採用された回答
Walter Roberson
2013 年 3 月 30 日
If you have the Symbolic toolbox,
syms x y
solve(x + 3*y - 5, 2*x + 4*y - 4)
2 件のコメント
その他の回答 (3 件)
Ali Al-khadher
2019 年 3 月 14 日
%{
ax+by=c....equ(1)
dx+ey=f....equ(2)
A=[a b;d e]
B=[c f]
sol=A/B
x=sol(1)
y=sol(2)
example
3x-9y=-42....equ(1)
2x+4y=2......equ(2)
%}
A = [3 -9;2 4]
b = [-42;2]
%Solve Ax=b as A\b
sol=A\b;
x=sol(1)
y=sol(2)
1 件のコメント
Timothy Beckham
2021 年 7 月 21 日
編集済み: Timothy Beckham
2021 年 7 月 21 日
I am grateful for the solution. I was looking for something similar and came across this page. Thank you very much!
SHREY VERMA
2021 年 8 月 26 日
You can use this file for solving 2, 3, 4 or more variable for solving linear equation, which may consist of real or complex number.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!