Search code examples
matlabzerotransfer-function

MatLab - Return value of the zero() function


I'm trying to implement a very simple transfer function to see its zeroes and poles. For example:

s=tf('s');
H= (s+5)/(s^2+3*s+2);
zeroes_H=zero(H);
poles_H=pole(H);

I can't seem to get the return values from the zero() and from the pole() functions. When I check my previous notes my code seems to work fine. What is a possible reason for the problem? Could it be related to a version difference? ( I was using 2019. Now I switched back to 2014.) If it is, what would be a more suitable way for the implementation?


Solution

  • the input of zero must be a system (in fact, a SISO, single-input-single-output system). So go with

    % create transfer function
    sys = tf([1,5],[1,3,2]);
    
    zeroes_H = zero(sys);
    poles_H = pole(sys);