MATLAB: Solving multiple symbolic equations to get (X/Z)

solve algebric equations symbolic

Hello everyone, My system is described by the following equations: X = a Y + b Z; Y = c X + d Z;
I want to use Matlab to get (X/Z) as a function of a, b, c, d ??

Best Answer

Hi,
i guess you want this:
syms X Y Z a b c d
eqn(1) = X == a * Y + b * Z;
eqn(2) = Y == c * X + d * Z;
sol = solve(eqn,[X Z]);
x = sol.X
z = sol.Z
which is:
x =
(Y*b + Y*a*d)/(d + b*c)
z =
(Y - Y*a*c)/(d + b*c)
Best regards
Stephan