I am trying to convert a state-space model to a transfer function in matlab RS2016a. I am using the function ss2tf(A,B,C,D)
which according to the documentation does exactly what I need. As an example I am using a static gain of 2.
Answer that matlab returns:
>> ss2tf(0,0,0,2)
ans =
2 0
*edit:
[2,0]
represents the transfer function 2/0 in the s domain. A transfer function with 0 as denominator does not make much sense and in this particular case it is wrong. The correct answer is [2,1]
which represents the transfer function 2/1 instead of 2/0.
*original: [2,0] represents the transfer function 2/0 in the s domain. In my opinion the answer should be [2,1] and therefore the transfer function should be 2/1 instead of 2/0.
expected answer:
>> ss2tf(0,0,0,2)
ans =
2 1
Is there an explanation for this behavior?
ss2tf
is a function with two output arguments, call it with two output arguments:
[b,a]=ss2tf(0,0,0,2)
You are only reading the nominator and the denominator a
is lost the way you are calling the function.