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일

3 개 추천

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

David H
David H 2014년 4월 30일
That seems to be what I was looking for
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개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2014년 4월 30일

댓글:

2022년 2월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by