How to return double or float values from poly2sym ?

14 ビュー (過去 30 日間)
zmath
zmath 2020 年 9 月 17 日
回答済み: Walter Roberson 2020 年 9 月 17 日
Hi,
Is it possible to make poly2sym returning double or float values instead integer fractions as shown below ?
p =
1.0000 2.5058 4.6396 5.2776 4.1493 2.1970 0.5122
>> poly2sym(p)
ans =
x^6 + (1410654599222945*x^5)/562949953421312 + (5223704754939755*x^4)/1125899906842624 + (5942013819553297*x^3)/1125899906842624 + (233585282
Thanks.
s.

採用された回答

Walter Roberson
Walter Roberson 2020 年 9 月 17 日
Is it possible to make poly2sym returning double or float values instead integer fractions as shown below ?
No. However, you can vpa() the result to get symbolic floating point numbers. These will not be single precision or double precision numbers.
You can pass a second parameter to vpa() to select the number of decimal places you want.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by