3

I have defined an array with transfer functions inside it. How can I find the position of a certain transfer function inside that array?

s = tf('s') % defining a transfer function
array = [s, s^2, s^3];
>> find(array==s)
undefined function 'eq' for input arguments of type 'tf'.
Amro
  • 123,847
  • 25
  • 243
  • 454
bergercookie
  • 2,542
  • 1
  • 30
  • 38

1 Answers1

2

Compare each element of the array with s using isequal:

arrayfun(@(x)isequal(x,s),array)
Daniel
  • 36,610
  • 3
  • 36
  • 69