partfrac() function returning same expression
2 次查看(过去 30 天)
显示 更早的评论
syms s
% Given expression
F = partfrac((s^2+2*s+1)/(s^3-5*s+3),s)
The output is as follows.
F =
(s^2 + 2*s + 1)/(s^3 - 5*s + 3)
I know syms has a big part to do with it but im not sure exactly what.
0 个评论
回答(1 个)
Dyuman Joshi
2024-1-31
移动:Steven Lord
2024-1-31
It gives the same expression as the output because the denominator can not be decomposed with the default factor format i.e. 'rational'.
You can specify a 'full' or 'real' factor mode but the output might not be easy to look at -
syms s
F1 = partfrac((s^2+2*s+1)/(s^3-5*s+3),s,'FactorMode','real')
F2 = partfrac((s^2+2*s+1)/(s^3-5*s+3),s,'FactorMode','full')
vpa(F2)
3 个评论
Dyuman Joshi
2024-1-31
I assume you mean to show the output with 4 significant digits -
syms s
F = partfrac((s^2+2*s+1)/(s^3-5*s+3),s,'FactorMode','full')
vpa(F, 4)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!