Receiving error "Unrecognized function or variable 'tf'" even though I have the Signal Processing Toolbox installed.

80 views (last 30 days)
I am trying to produce a bode plot using the tf function. My code is as follows:
num = [10000000000000000000000000000 7000000000000000000000000000000];
den = [1 7540690 21324854073600 26807731666619904000 12647107451415440994336768 10730685839764156310146252800];
G = tf(num, den)
bode(G),grid;
The error is in line 4. I am receiving the error message despite having the Signal Processing Toolbox installed. When I type "ver" into the command window I get this:
MATLAB Version: 9.10.0.1669831 (R2021a) Update 2
Operating System: Microsoft Windows 10 Home Version 10.0 (Build 19042)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.10 (R2021a)
Signal Processing Toolbox Version 8.6 (R2021a)
I am new to MATLAB so I would appreciate any pointers. Thank you.
  2 Comments
Matthew Crain
Matthew Crain on 6 Jun 2021
Nevermind! I found that I needed the Control Systems Toolbox add-on. Apparently the tf function is not a part of the Signals Processing Toolbox. The more you know!
Brian Mcnulty
Brian Mcnulty on 18 Apr 2022
the 'tf' command is not recognized and the command window provides a reccomendation instead.
I have all the correct toolboxes installed, however, the error persists.
What can I do to alleviate this issue. Any suggestions would be greatly appreciated. Thank you in advance.

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 6 Jun 2021
which -all tf
/MATLAB/toolbox/control/ctrlmodels/@tf/tf.m % tf constructor /MATLAB/toolbox/mpc/mpc/@mpc/tf.m % Shadowed mpc method /MATLAB/toolbox/control/ctrlmodels/@DynamicSystem/tf.m % Shadowed DynamicSystem method /MATLAB/toolbox/ident/ident/@idParametric/tf.m % Shadowed idParametric method /MATLAB/toolbox/shared/controllib/engine/@StaticModel/tf.m % Shadowed StaticModel method
There are several functions named tf in various MathWorks products, but most of them are intended for use in converting some sort of other object into a tf object. As you have learned the tf function in Control System Toolbox (the first on that list) is what you should use for creating a tf object from raw numeric data.

Categories

Find more on Get Started with Control System Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!