MATLAB: How to solve an equation using “solve” and get a decimal approx

decimalsolve

I'm solving an equation for x using "solve(eqn,x)" and everything works fine but I get the fraction answer and I want the decimal answer. How can I change it?

Best Answer

eq='x^2-2*x-7'
s=double(solve(eq))
Related Question