solving two symbolic equations simultaneously
79 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pouyan Msgn
el 13 de Jul. de 2019
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 comentarios
Respuesta aceptada
Más respuestas (1)
SYED IMTIAZ ALI SHAH
el 13 de Jul. de 2019
Hi, this may help. Write one extra line after your code
sol.x
sol.y
0 comentarios
Ver también
Categorías
Más información sobre Equation Solving en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!