Transfer function long format

Hi,
So I wrote this function to give me the transfer function of a state space model.
A = [0,1,0;0,-1,2;0,0,-2];
B = [0;0;1];
C = [1,0,0];
D = 0;
[n,d] = ss2tf(A,B,C,D); % gives numerator and denominator of transfer function
partCtf = tf(n,d); % takes numerator and denominator and rearrange them into a proper fraction
display(partCtf);
However, it keeps giving me this transfer function
Transfer function:
2.665e-015 s^2 + 1.332e-015 s + 2
---------------------------------
s^3 + 3 s^2 + 2 s
When i compute the transfer function by hand, i get the same answer except for the two first values in the numerator, they should be zero. Is there anyway so I can make it so the first two values in the numerator are zero?

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 9 日
編集済み: Azzi Abdelmalek 2012 年 12 月 9 日

0 投票

2.665e-015 is almost equal to zero, because of numerical errors. to eliminate the two first elements
n(1:2)=[]
model=tf(n,d)

カテゴリ

ヘルプ センター および File ExchangeDynamic System Models についてさらに検索

質問済み:

2012 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by