How to solve a set of symbolic equations for the same variable?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Is there a way to make the following work and solve the following set of symbolic equations for the same variable and save the output in an array?
syms x a
eqns = [a==x+2, a==5*x];
xvalues = vpasolve( subs(eqns,a,[1,2]) , [x,x] );
1 commentaire
Star Strider
le 2 Jan 2021
I do not believe any solution exists to those equations, especially after the subs call.
Réponses (1)
fouad koudsi
le 7 Jan 2021
Becasue you hava two equations with two unknowns (x & a), so you will not need to substitute any value for a:
code:
syms x a
eqns = [a==x+2 a==5*x]
[xsol asol]=solve(eqns,[x a])
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!