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

29 次查看(过去 30 天)
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?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-12-7
eq='x^2-2*x-7'
s=double(solve(eq))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by