(adsbygoogle = window.adsbygoogle || []).push({}); [MATLAB] -- Getting Error

Code:

% Define variables for wn and z

wn = 5;

z1 = 0; z2 = 0.2; z3 = 0.9; z4 = 1; z5 = 2; z6 = 30;

% Define transfer functions

num = [wn^2];

den1 = [1, 2*z1*wn, wn^2];

den2 = [1, 2*z2*wn, wn^2];

den3 = [1, 2*z3*wn, wn^2];

den4 = [1, 2*z4*wn, wn^2];

den5 = [1, 2*z5*wn, wn^2];

den6 = [1, 2*z6*wn, wn^2];

tf_1 = tf(num, den1);

tf_2 = tf(num, den2);

tf_3 = tf(num, den3);

tf_4 = tf(num, den4);

tf_5 = tf(num, den5);

tf_6 = tf(num, den6);

% Create plots for step response

step(tf_1)

step(tf_2)

step(tf_3)

step(tf_4)

step(tf_5)

step(tf_6)

I am getting the error:

??? Undefined function or method 'tf' for input arguments of type 'double'.

Error in ==> HW9_2 at 13

tf_1 = tf(num, den1);

Any ideas why?

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# [MATLAB] - Getting Error

Loading...

Similar Threads - MATLAB Getting Error | Date |
---|---|

I don't get a reasonable output for my code? | Mar 18, 2017 |

How long does it take to get good at matlab? | Apr 24, 2015 |

How to get specific frequency and time values for .wav file | Mar 3, 2015 |

[MATLAB] I am getting this error, could anyone solve it please? | Dec 8, 2014 |

Matlab basic - how to get around floating point? | Aug 30, 2014 |

**Physics Forums - The Fusion of Science and Community**