MATLAB: Symbolic solution to a system of algebraic equations

symbolic

I get an error message stating "Reference to non existent field b" when I try to solve for b in the following system of algebraic equations.
How can I modify the code?
syms a b x N g b L m
eqns = [(1/b)*(-2*N*sin(a))/3==m*L, x/b==-(5*L*cos(a))/6+(5*a^2*L*sin(a))/6, N/b==m*(5*L*sin(a))/6+(5*a^2*L)/(6*cos(a) +3*g)];
S = solve(eqns);
sol = [S.b]

Best Answer

syms a b x N g b L m
eqns = [(1/b)*(-2*N*sin(a))/3==m*L, x/b==-(5*L*cos(a))/6+(5*a^2*L*sin(a))/6, N/b==m*(5*L*sin(a))/6+(5*a^2*L)/(6*cos(a) +3*g)];
S = solve(eqns,[b m x]);
sol = S.b
This will give you the solution.