I want to verify that two transfer functions are equal. For example: Kc = 0.4262; Ti=1.35; C1 = pidstd(Kc,Ti); tf(C1) s = tf('s'); Gc1 = Kc*(1+1/(Ti*s)) assert(tf(C1) == Gc1) Raises: Undefined operator '==' for input arguments of type 'tf'. Also note: Gc1 tf(C1) Gc1 - tf(C1) Gc1 = 0.5754 s + 0.4262 ----------------- 1.35 s Continuous-time transfer function. ans = 0.4262 s + 0.3157 ----------------- s Continuous-time transfer function. ans = 0 Static gain.
Kshitij Singh answered .
2025-11-20
isequal(tfdata(tf(C1) - Gc1), {[0]})
This will probably fail if there are delays in the tf.