MATLAB Answers

0

System of equations zero variable

Asked by Jessca Sudderth on 18 May 2018 at 14:27

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?

  0 Comments

Sign in to comment.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today