Format result in a live script
古いコメントを表示
I am working with symbolic variables and at the same time with real variables, when I enter for example sin (0)*cos (t1) the result is a fraction that tends to zero, I would like to be able to make the value not be shown in fractional form, but instead just be zero.

Thank you.
Diego
回答 (1 件)
Walter Roberson
2020 年 10 月 4 日
Convert each of your real-valued constants to symbolic as early as you can, preferably symbolic rationals. For example, instead of
0.75*pi
use
Q = @(v) sym(v)
Q(0.75)*Q(pi)
カテゴリ
ヘルプ センター および File Exchange で Symbolic Variables, Expressions, Functions, and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!