Simplifying numbers in symbolic function

16 ビュー (過去 30 日間)
David H
David H 2014 年 4 月 30 日
コメント済み: Kyle Langford 2022 年 2 月 18 日
Upon substituting into a symbolic expression I get very long analytic expressions for numbers, e.g. (2^(1/2)*(3^(1/2)*pi*(5^(1/2)/4 - 1/4)*(1/120000 + i/6000000)t + .... is there any way to simplify these numbers down to a single double precision complex number in the symbolic expression to make for easier viewing? I can't just use double (expression) as it still have a symbolic variable.
Many thanks.
David

採用された回答

Mischa Kim
Mischa Kim 2014 年 4 月 30 日
編集済み: Mischa Kim 2014 年 4 月 30 日
David, have you tried vpa(expr)?
syms x t
x = 2^(1/2)*3^(1/2)*pi*(5^(1/2)/4 - 1/4)*(1/120000 + i/6000000)*t;
vpa(x,10) % you can adjust the number of significant digits
ans =
t*(0.00001981648468 + 0.0000003963296937*i)
  3 件のコメント
Mr. G
Mr. G 2021 年 2 月 11 日
編集済み: Mr. G 2021 年 2 月 11 日
Great job, Thx.
It really works!
Kyle Langford
Kyle Langford 2022 年 2 月 18 日
Thank you!

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by