I have these two equations where x, y
and z
are variables and p1, p2
and p3
are parameter. Can MATLAB find parametric/symbolic solutions for x y z
based on p1, p2, p3
?
2(x−p1)+2(xy−p3)y = 0
2(y−p2)+2(xy−p3)x = 0
I have these two equations where x, y
and z
are variables and p1, p2
and p3
are parameter. Can MATLAB find parametric/symbolic solutions for x y z
based on p1, p2, p3
?
2(x−p1)+2(xy−p3)y = 0
2(y−p2)+2(xy−p3)x = 0
Copyright © 2021 Jogjafile Inc.
Simply put yes. Take all of your variables, use
syms
to define each of your variables so that they are symbolic variables, then usesolve
to solve the equation for you. You specify the two equations as two parameters intosolve
. The output (which we will store insol
) will return a structure that contains anx
field and ay
field, as your equation is defined with respect to two variables, andp1,p2,p3
are parameters. In other words, do this:You can access the solution of what
x
andy
are by accessing each of their respective fields:You will get a warning though, stating that the solution is parametrized by symbols, but that is to be expected. Specifically: