0

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?

tamuno
  • 103
  • 1
  • 11
  • Does the code run and not return values or are there warnings/errors? – David May 26 '20 at 01:47
  • @David I get an error message for the line with zero() function, related to 'subsindex', stating: "Function 'subsindex' is not defined for values of class 'tf'." From what I understand I am passing the argument H in an incorrect way (possibly?). – tamuno May 26 '20 at 02:07

1 Answers1

2

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);
Paolo
  • 21,270
  • 6
  • 38
  • 69
max
  • 3,915
  • 2
  • 9
  • 25
  • Great! This method seems to work just fine without any problems. Just one detail: My initial code just started working properly today without any changes whatsoever. However I believe the solution you've shared is the better way. – tamuno May 26 '20 at 15:59