How to solve an equation using "solve" and get a decimal approx?

59 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 7 de Dic. de 2014
eq='x^2-2*x-7'
s=double(solve(eq))

Más respuestas (0)

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by