How to extract information from sys

조회 수: 7 (최근 30일)
David Koenig
David Koenig 2019년 5월 11일
댓글: Star Strider 2019년 5월 11일
I would like to extract the coefficients in a discrete transfer function that I construct from a continuous transfer function. For example,
Fs=44100;
Ts=1/Fs;
num=[.001 0 ];
den=[.001 1];
sys=tf(num,den);
sysD=c2d(sys,Ts);
Now, if I do the following:
>> sysD
sysD =
z - 1
----------
z - 0.9776
Sample time: 2.2676e-05 seconds
Discrete-time transfer function.
So,
how can I extract the coefficients a1,a2, b1,b2 in the z-transform
(b1*z+b2)/(a1*z+a2)? That is, can I find b1=1, b2=-1, a1=1, a2=-.9776?
Thanks.

채택된 답변

Star Strider
Star Strider 2019년 5월 11일
The system object is a structure array of cells, so:
N = sysD.Numerator{:}
D = sysD.Denominator{:}
produces:
N =
1 -1
D =
1 -0.977579425259153
That should do what you want.
  댓글 수: 2
David Koenig
David Koenig 2019년 5월 11일
Thanks for you response, Strider. That was exactly what I was looking for!
Star Strider
Star Strider 2019년 5월 11일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by