How to convert a transfer fuction (tf class) to a symbolic equation (sym)?

358 views (last 30 days)
I have a transfer function that I need in symbolic form but I haven't been able to find a way of doing this. This is what I have:
EQN =
6
-----------
s^3 + 2 s^2
Continuous-time transfer function.
This is what I need:
eqn = 6/(s^3 + 2*s^2)
Any ideas?

Accepted Answer

lasttccasey
lasttccasey on 29 Sep 2015
Never mind I figured it out, but to those who want to know:
sys = tf([1 0],[1 2 3])
[Num,Den] = tfdata(sys);
sys_syms = poly2sym(cell2mat(Num),s)/poly2sym(cell2mat(Den),s)
Credit goes to:
  1 Comment
lorenzo sguaitamatti
lorenzo sguaitamatti on 25 Jan 2019
Reading your solution I found this way:
[Num,Den] = tfdata(sys,'v')
syms s
sys_syms=poly2sym(Num,s)/poly2sym(Den,s)

Sign in to comment.

More Answers (1)

Fabian Acuña
Fabian Acuña on 11 May 2022
s = tf('s')
G = s^3/(s^2 + 3*s + s^4 + 1)
syms s
Numerator = poly2sym(G.Numerator{1,1},s)
Denominator = poly2sym(G.Denominator{1,1},s)
Gsym = Numerator/Denominator

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!