MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB简化函数除以公因子问题 (https://www.labfans.com/bbs/showthread.php?t=24141)

poster 2019-12-10 20:48

MATLAB简化函数除以公因子问题
 
我有一个复杂的表达式H,它来自其他几个复杂的中间步骤。我想得到[ND] = numden(H)。

问题在于,表达式H,N和D未被“求值”,并且它们也没有被简化和除以公因数。

我正在使用syms x。

例如,我得到

H =(27 + 81 *(x ^ 2-987605098534947 / 1125899906842624 * x -...

那太疯狂了..但是很明显,

H =(27 + 81 *(x ^ 2-0.8772 * x -...

我怎样才能将其评估为最简单的形式?

提前致谢!

编辑:我发现最接近的赌注是使用VPA



[B]回答:[/B]

我自己的解决方法:
[LIST=1][*] [num den] = numden(H)[*] num = vpa(num,4); den = vpa(den,4);[*] H = num / den;[*]从1开始重复,直到获得所需的num和den。[/LIST]
[url=https://stackoverflow.com/questions/4236374]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 14:18

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.