Undefined function 'tf' for input arguments of type 'double'.

13 ビュー (過去 30 日間)
Zhou Xi
Zhou Xi 2015 年 8 月 22 日
コメント済み: Walter Roberson 2015 年 8 月 24 日
Hello everybody,
I have problem using the function "tf".
My code is as below:
p=bodeoptions;
p.grid='on';
p.Xlim={[1,500]};
p.XlimMode={'manual'};
num=[3.015,359.0,1.702e5];
den=[0.2758,120.9,55488.0,3.196e6,8.816e8];
sys=tf(num,den);
The error message is :
Undefined function 'tf' for input arguments of type 'double'.
I checked my toolbox and found the following information.
>> which tf
D:\Softwares\Study\Matlab2012b\toolbox\ident\ident\@idParametric\tf.m % idParametric method
>> which('tf','-all')
D:\Softwares\Study\Matlab2012b\toolbox\ident\ident\@idParametric\tf.m % idParametric method
D:\Softwares\Study\Matlab2012b\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method
D:\Softwares\Study\Matlab2012b\toolbox\signal\signal\@dfilt\tf.m % dfilt method
>> ver
It seems my default "tf" function is not the controllib.tf. Is that the reason why it is wrong? How to make it right?
Thank you

回答 (3 件)

Star Strider
Star Strider 2015 年 8 月 22 日
編集済み: Star Strider 2015 年 8 月 22 日
I have the System Identification, Control, and Signal Processing Toolboxes, and the only tf function that comes up in the ‘Help’ documentation that has the syntax you are using is in the Control Systems Toolbox:
C:\Program Files\MATLAB\R2015a\toolbox\control\control\@tf\tf.m % tf constructor
C:\Program Files\MATLAB\R2015a\toolbox\control\control\@DynamicSystem\tf.m % DynamicSystem method
You have to have the Control Systems Toolbox to use it as you intend.

Zhou Xi
Zhou Xi 2015 年 8 月 22 日
My matlab version is R2012b. It seems have no control systems toolbox. Can I install such toolbox of version R2015?
  2 件のコメント
John D'Errico
John D'Errico 2015 年 8 月 22 日
編集済み: John D'Errico 2015 年 8 月 22 日
No. You can only install toolboxes that are concurrent with your release. So you would need to upgrade your MATLAB release.
Star Strider
Star Strider 2015 年 8 月 22 日
John is correct. However, the tf function has been part of the Control Systems Toolbox since it was introduced in the 1990s, so the R2012 versions will have that function.

サインインしてコメントする。


Zhou Xi
Zhou Xi 2015 年 8 月 24 日
Hi Star Strider
It seems my version has the toolbox, otherwise why it show the following information?
>> which('tf','-all')
D:\Softwares\Study\Matlab2012b\toolbox\ident\ident\@idParametric\tf.m % idParametric method
D:\Softwares\Study\Matlab2012b\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method
D:\Softwares\Study\Matlab2012b\toolbox\signal\signal\@dfilt\tf.m % dfilt method
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 8 月 24 日
You might need to reinstall the Control System Toolbox.
Notice that the tf.m it found for controllib is for StaticModel objects only. Those do appear to be part of the Control Systems Toolbox, but they are certainly not the only tf.m that should be present for Control Systems.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeControl System Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by