partfrac() function returning same expression

syms s
% Given expression
F = partfrac((s^2+2*s+1)/(s^3-5*s+3),s)
F = 
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.

답변 (1개)

Dyuman Joshi
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')
F1 = 
F2 = partfrac((s^2+2*s+1)/(s^3-5*s+3),s,'FactorMode','full')
F2 = 
vpa(F2)
ans = 

댓글 수: 3

Esteban
Esteban 2024년 1월 31일
Thank you. When I attempted I did try full but like you said the output was a bit crazy. Is there any way to format the ouput short ? for the factor format real?
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')
F = 
vpa(F, 4)
ans = 
Any updates, @Esteban?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2024년 1월 31일

댓글:

2024년 2월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by