Simplify coefficients on symbolic fraction

2 views (last 30 days)
Hello, I will get right into it with an example:
I have this symbolic fraction:
(360107496127452805861054873600*z + 425427235801022494957005157967)/(60847228810955011271841753858048*z^2 - 156454140823163360723132970172416*z + 100320120403779201256199576503770)
As you can see it has pretty big coefficients. Simplifying it should get something like this:
0.0059182*(z+1.181)/((z-1.221)*(z-1.35))
Is there any simple way to get to this result? I've been messing with simplify(), collect() and such, but got nothing.
Thank you in advance.

Answers (1)

John D'Errico
John D'Errico on 12 Sep 2018
Did you try vpa? Yeah, I suppose the name might not be obvious.
syms z
vpa((360107496127452805861054873600*z + 425427235801022494957005157967)/(60847228810955011271841753858048*z^2 - 156454140823163360723132970172416*z + 100320120403779201256199576503770),5)
ans =
(3.6011e29*z + 4.2543e29)/(6.0847e31*z^2 - 1.5645e32*z + 1.0032e32)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!