solving two symbolic equations simultaneously
조회 수: 47 (최근 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!