MATLAB: How to place the coefficients of the y in a vector to find the roots

roots

clear all
clc
syms st
stx = 1
sty = 2
stz = 3
tauxy = 4
tauyz = 5
tauzx = 6
y = st.^3 - (stx +sty + stz).*st.^2 + (stx.*sty +stx.*stz + sty.*stz -tauxy.^2 -tauyz.^2-tauzx.^2).*st - (stx.*sty.*stz+2.*tauxy.*tauyz.*tauzx-stx.*tauyz.^2-sty.*tauzx.^2-stz.*tauxy.^2)
x = roots(y)
Answer:
y =
st^3 - 6*st^2 - 66*st - 101
x =
Empty sym: 0-by-1

Best Answer

clear all
syms st
stx = 1
sty = 2
stz = 3
tauxy = 4
tauyz = 5
tauzx = 6
y = st.^3 - (stx +sty + stz).*st.^2 + (stx.*sty +stx.*stz + sty.*stz -tauxy.^2 -tauyz.^2-tauzx.^2).*st - (stx.*sty.*stz+2.*tauxy.*tauyz.*tauzx-stx.*tauyz.^2-sty.*tauzx.^2-stz.*tauxy.^2)
x = roots(sym2poly(y))
Gives:
x =
12.1284
-4.0946
-2.0338