MATLAB: Symbolic Equation Solver- should work, but doesn’t!

solvesymbolic equationsymbolic expression

Hi,
I have a matrix that includes terms using the symbol "s". I need the exponential of that matrix, and then the determinant of that, both in terms of s, which I then want to set equal to 0 to solve for s. For example:
syms s
F=[0,1,0,0;0,0,1,0;0,0,0,1;m*s^2/EI,0,0,0]
Y=vpa(expm(F))
Step2=det(4*Y)
So now I have a long equation in terms of the symbol s. According to the mathworks website http://www.mathworks.com/help/toolbox/symbolic/brvfu8o-1.html , I should be able to do this:
"Algebraic Equations with One Symbolic Variable
Use the double equal sign (==) to define an equation. Then you can solve the equation by calling the solve function. For example, solve this equation:
syms x
solve(x^3 - 6*x^2 == 6 - 11*x)
ans =
1
2
3"
So I've defined s as a symbol, but when I use solve(Step2==0,s)
it gives me an error- essentially that symbol can't be used in a logic expression?
So what's the deal? Anyone have any idea why it isn't working? Thanks!!! Kaitlin

Best Answer

Just use
solve(Step2,s)
Note: the vpa() step probably is not doing you much good for accurate solutions. It might possibly make the solution faster, though.
Related Question