Borrar filtros
Borrar filtros

partfrac() function returning same expression

2 visualizaciones (últimos 30 días)
Esteban
Esteban el 31 de En. de 2024
Comentada: Dyuman Joshi el 19 de Feb. de 2024
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.

Respuestas (1)

Dyuman Joshi
Dyuman Joshi el 31 de En. de 2024
Movida: Steven Lord el 31 de En. de 2024
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 comentarios
Dyuman Joshi
Dyuman Joshi el 31 de En. de 2024
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 = 
Dyuman Joshi
Dyuman Joshi el 19 de Feb. de 2024
Any updates, @Esteban?

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by