If S is a symbolic expression,
attempts to find values of the symbolic variable in S (as determined by symvar) for which S is zero. For example,
syms a b c x S = a*x^2 + b*x + c; solve(S)
uses the familiar quadratic formula to produce
ans = -(b + (b^2 - 4*a*c)^(1/2))/(2*a) -(b - (b^2 - 4*a*c)^(1/2))/(2*a)
This is a symbolic vector whose elements are the two solutions.
If you want to solve for a specific variable, you must specify that variable as an additional argument. For example, if you want to solve S for b, use the command
b = solve(S, b)
b = -(a*x^2 + c)/x
Note that these examples assume equations of the form f(x) = 0. To solve equations of the form f(x) = q(x), use the operator ==. For example, this command
syms x s = solve(cos(2*x) + sin(x) == 1)
returns a vector with three solutions.
s = 0 pi/6 (5*pi)/6
There are also solutions at each of these results plus kπ for integer k, as you can see in the MuPAD® solution: