Simplifying numbers in symbolic function

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

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 30 Apr. 2014
Bearbeitet: Mischa Kim am 30 Apr. 2014

3 Stimmen

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 Kommentare

David H
David H am 30 Apr. 2014
That seems to be what I was looking for
Mr. G
Mr. G am 11 Feb. 2021
Bearbeitet: Mr. G am 11 Feb. 2021
Great job, Thx.
It really works!
Kyle Langford
Kyle Langford am 18 Feb. 2022
Thank you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by