subs command gives symbolic output instead of integers

2 ビュー (過去 30 日間)
Akkineni
Akkineni 2014 年 3 月 11 日
回答済み: Walter Roberson 2014 年 3 月 11 日
I observe 'subs' command in Matlab 2013b and 2014a gives output in a symbolic fassion. I have to use 'double' command to convert into numbers. Where as in previous versions.

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 3 月 11 日
I do not have the toolbox to test with, but symbolic numbers is what I would expect, due to the potential for loss of precision if double() is always output. For example,
subs(sym('2^N'), 'N', 55)
I would expect to give the exact integer result rather than converting it to double (which would only have 53 bits precision rather than e.g., 55)
Even something like,
subs(sym('PI/2'), 'PI', sym('pi'))
I would certainly expect to give Pi/2 as symbolic form, not the double precision approximation.

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by