System of equations zero variable
Show older comments
I would like to solve the following series of equations
syms x y z
sol = solve([0*x + 1*y + 2*z ==4, x+y+z ==4], [x, y, z])
xsol = sol.x
ysol = sol.y
zsol = sol.z
Where the answers would be [0 4 0; 1 2 1; 2 0 2] but because MATLAB solves the first equation as 1y + 2z = 4 (removing the x variable because it's multiplied times 0) the only solution that it can come up with that satisfies both equations is 0 4 0. How do I fix this?
Answers (0)
Categories
Find more on Equation Solving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!