solving two symbolic equations simultaneously
60 次查看(过去 30 天)
显示 更早的评论
Hi !
I will not use matrix to solve this problem; if we have:
x + y = a
x - y =b
We know we can get by hand and paper: x=(a+b)/2 and y=(a-b)/2. How can I get the same resulte by using SOLVE function in Matlab?
Here comes my attempt:
clear all
clc
syms x y a b
eq1=a==x+y;
eq2=b==x-y;
sol=solve([eq1 eq2],[x y])
0 个评论
采纳的回答
更多回答(1 个)
SYED IMTIAZ ALI SHAH
2019-7-13
Hi, this may help. Write one extra line after your code
sol.x
sol.y
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!