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

22 ビュー (過去 30 日間)
Joey
Joey 2014 年 12 月 7 日
編集済み: Julián Escobar 2022 年 7 月 4 日
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))
  2 件のコメント
Joey
Joey 2014 年 12 月 7 日
perfect, thanks!
Julián Escobar
Julián Escobar 2022 年 7 月 4 日
編集済み: Julián Escobar 2022 年 7 月 4 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by