The error occurs because the “solve” function is expecting symbolic variables as input, but numeric values are assigned to “x”, “y”, and “z” using “linspace”. This reassignment overrides the symbolic variables initially declared with “syms”. To resolve this issue, ensure that “x”, “y”, and “z” remain symbolic when passed to the solve function.
Remove the “linspace” statements to ensure parameters “x”, “y”, and “z” remains symbolic.
Here is the MATLAB code with the required changes:
clc;
syms x y z;
format long;
% Define the symbolic equation
a = 588545.909;
b = 10167.688;
c = 150;
eqn = a*x + b*y + c*z == 189900000;
% Solve the equation for the symbolic variables
s = solve(eqn, [x, y, z]);
disp(s);
For more information on the functions used refer to the following documentation:
I hope this will help resolving the issue.