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

조회 수: 39 (최근 30일)
Christopher Piland
Christopher Piland 2019년 10월 17일
댓글: Anis Ferjani 2022년 12월 7일
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
Walter Roberson
Walter Roberson 2021년 6월 10일
편집: Walter Roberson 2021년 6월 12일
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 2021년 7월 4일
the V is a space frequency ! I noticed that, so is there a solution for this?

댓글을 달려면 로그인하십시오.

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 12일
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
Walter Roberson
Walter Roberson 2022년 12월 6일
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.
Anis Ferjani
Anis Ferjani 2022년 12월 7일
@walter robertson Thank you, that clarifies everything.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by