MATLAB simplification functions divide by common factors problem
I have a complicated expression H which is derived from several other complicated intermediate step. I want to get the [N D] = numden(H).
The problem is that the expression H, N and D is not being "evaluated" and they are also not simplified and divided by common factors.
I am using syms x.
For example, I get
H = (27+81*(x^2-987605098534947/1125899906842624*x-...
That is just so cra开发者_开发技巧zy.. but clearly,
H = (27+81*(x^2-0.8772*x-...
how can I get it to evaluate to simplest form?
Thanks in advance!
EDIT: I found out the closest bet is using VPA
My own workaround:
- [num den] = numden(H)
- num = vpa(num, 4); den = vpa(den, 4);
- H = num/den;
- repeat from 1 until desired num and den are obtained.
精彩评论