How can I extract numerator and denominator as polynomials from a transfer function?
345 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Paolo Arighi
am 26 Aug. 2017
Kommentiert: Petr Danielka
am 10 Dez. 2022
I'm am having some stupid trouble with transfer functions.
If I have to write the tf:
s^2 + 2 s
G(s) = ---------------------
s^3 - 2 s^2 + 4 s + 1
I could write: G=tf([2 1 0],[1 -2 4 1])
But now, I would like to extract numerator and denominator as array. If I write: [Num, Den]=tfdata(G) the programm gives me them as cells
Num =
cell
[1×4 double]
Den =
cell
[1×4 double]
How can I take numerator and denominator as arrays? I would like to receive
Num =
[2 1 0]
Den =
[1 -2 4 1]
Thank you
3 Kommentare
Petr Danielka
am 10 Dez. 2022
If you make the "Transfer Function" block bigger, it will show properly
Akzeptierte Antwort
Thiago Barreto
am 16 Aug. 2018
Just do this:
G = tf([2 1 0],[1 -2 4 1]);
[num den] = tfdata(G, 'v');
num =
0 2 1 0
den =
1 -2 4 1
1 Kommentar
Fabricio Arturo Balboa Cavazos
am 30 Apr. 2020
I needed to extract que coeficients to use the Jury criteria, thanks a lot man.
Weitere Antworten (1)
Bill Tubbs
am 24 Feb. 2020
Bearbeitet: Bill Tubbs
am 24 Feb. 2020
The answer is good but what if I want to go one step further?
What if I want A(s) and B(s) where G(s) = B(s)/A(s)?
This seems to work, is this the right way to do it?
>> B = tf(num,1)
B =
2 s^2 + s
Continuous-time transfer function.
>> A = tf(den,1)
A =
s^3 - 2 s^2 + 4 s + 1
Continuous-time transfer function.
Siehe auch
Kategorien
Mehr zu Get Started with Control System Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!