MATLAB: Problem in linsolve , the equation on the left side not accepted

equationlinsolveparametric

Hi All
I am defining equation as :
M_num = – (19*c2)/4 – (11*c3)/18 – 50 ;
M_n2 = – 7*c2 – (5*c3)/18 – 50 ;
then I have :
linsolve({M_num = 0, M_n2 = 0}, {c2, c3}) ;
and I get the error :
Error: The expression to the left of the equals sign is not a valid target for an assignment.
WHY ??

Best Answer

Farzad - see the documentation for linsolve. If you are trying to solve the system of equations Ax=B, then you need to define your A and B with two unknowns of c2 and c3, then you should try something like
A = [-19/4 -11/18 ; -7 -5/18];
B = [50 ; 5];
X = linsolve(A,B);