MATLAB: How to get Numerical value from a Symbol

symbolic

Hi, everyone,
I was working on extracting the numerical value of a symbol, however, it does't work for me.
x=2*y+5*y^3+3*y^5 and I have a series values of 'x'. What I want is to get the numerical values of 'y' which contains only pure real values.
When I wrote "solve('x=2*y+5*y^3+3*y^5','y')", it gave me 5 numerical answers on screen. However, it showed "5*1 syms" in the Workspace. Moreover, when I put the "solve" in the 'for' loop, it only showed 1*1 sym.
I am wondering who could help me this. Your suggestion is highly appreciated!
Thank you

Best Answer

Use double() to convert a symbolic number to a double precision value.