manually coding partial fractions

4 次查看(过去 30 天)
Hi i was wondering if there is a way to maunually code partial fractions, i want to be able time the LHS denominator to the RHS and then group the values in terms of x^3,x^2 and x.
This is the question i am trying to solve.
I have done the first part by hand and used matlab to check my answer but i cant find a way to group the terms.
If anyone could help or direct me in the right direction it would be much Appreciated.
syms A1 A2 A3 A4
eqn1 = 2*A1 + A4 == 3;
eqn2 = A3 - 2*A4 == -2;
eqn3 = -A1 -2*A3 + A4 == -3;
eqn4 = -A1 + A3 ==2;
[M,B] = equationsToMatrix([eqn1,eqn2,eqn3,eqn4],[A1,A2,A3,A4])
X = linsolve(M,B)

回答(1 个)

Star Strider
Star Strider 2020-4-24
The Symbolic Math Toolbox partfrac function (introduced in R2015a) will do exactly what you want:
syms x
Eq = (2*x^5 -2*x^4 + 2*x^3 + 3) / (2*x^4 - 2*x^3 - x^2 + 1);
Eqpf = partfrac(Eq, x)
Eqpf = vpa(Eqpf)
producing:

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by