tf or "transfer function" will not work on my fresh install of matlab

29 views (last 30 days)
So I want to use tf to make a transfer function. I get this insted...
Error using tf (line 249)
Invalid syntax. The first input argument of the "tf" command cannot be a string.
I have tried to track down the problem in numerous ways. It wount even run the tf code example that matlab provides.
the code I have tried so far are:
clear all
clc
s = tf('s');
sys = s/(s^2 + 2*s + 10)
***************************************
***************
function Gs = tf1or2(gainORzeta, tauORwn, order) %%This is a function that takes gain,tou,order and greates a transfer function
if order == 1
disp ('This is a first order transfer function')
Gs=tf(gainORzeta,tauORwn)
end
end
*****************************************************
I have also tried to directly input numbers into the tf function to get it to work. Same error
Waiting for some help...
  5 Comments
Walter Roberson
Walter Roberson on 10 Jun 2021
Edited: Walter Roberson on 12 Jun 2021
No, that is not typical. If you had that as the laplace transform of some function then you should be able to do an inverse laplace in order to get the original time-domain function. However, there is no inverse laplace defined for that using standard mathematical functions.
If you try an approach such as taking a taylor approximation of the cos() and then take the inverse laplace of that, then you get an expression which is the sum of coefficients times various derivatives of dirac delta. The limit for that is 0 for all non-zero times because of the dirac delta... but the limit is also 0 for time 0. Except possibly for some oddity due to dealing with infinity, you can see that cos(2*pi*v) cannot be the laplace transform of any useful function (or else that there is some mathematical reason why you cannot use taylor series in these kinds of analysis)
(My internal tracking number for this is T0098910)
lounis chehrit
lounis chehrit on 4 Jul 2021
the V is a space frequency ! I noticed that, so is there a solution for this?

Sign in to comment.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 12 Jun 2021
One of the common errs happen with many users is that accidentally without intention you may have called a variable or m-file or fcn file with 'tf'.
Have you tried this syntax to generate the transfer function formulation:
T = tf([1, 1], [1 2 3]);
  3 Comments
Walter Roberson
Walter Roberson on 6 Dec 2022
tf() is part of the Control System Toolbox product, which is an optional product that must be licensed and installed.
If you happen to have purchased the Student Suite bundle then that toolbox is included in the bundle, but you might not happen to have installed it yet.

Sign in to comment.

Categories

Find more on MATLAB 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!