简体   繁体   English

错误:tf' function 属于您已安装但未加载的 Octave Forge 中的控件 package

[英]error: tf' function belongs to the control package from Octave Forge which you have installed but not loaded

i'm doing a program in octave in which i got我正在做一个八度音程的程序,我得到了

t=0:.0002:20;

Gs=tf(100,[1 10])

u1=sin(t);

y1=lsim(Gs,u1,t);

plot(t,9.95*sin(t-0.1),'r',t,y1,'b')

However when i write Gs=tf(100,[1 10]) in the command window it appears "warning: the 'tf' function belongs to the control package from Octave Forge which you have installed but not loaded. To load the package, run 'pkg load control' from the Octave prompt."但是,当我在命令 window 中写入 Gs=tf(100,[1 10]) 时,它会出现“警告:'tf' function 属于您已安装但未加载的 Octave Forge 中的控件 package。要加载 package,从 Octave 提示符运行‘pkg load control’。” How can i load this package?我如何加载这个 package? I trully can't understand it... enter image description here我真的无法理解...在这里输入图片描述

enter image description here在此处输入图像描述

When i load it it appears:当我加载它时,它出现:

pkg load control warning: addpath: C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages\control-3.2.0: No such file or d irectory warning: called from load_packages_and_dependencies at line 48 column 5 load_packages at line 47 column 3 pkg at line 461 column 7 pkg 加载控制警告:addpath: C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages\control-3.2.0: No such file or directory warning: called from load_packages_and_dependencies at line 48 column 5 load_packages at line 47第 3 栏 pkg 第 461 栏第 7 栏

t=0:.0002:20; t=0:.0002:20; Gs=tf(100,[1 10]) error: could not find any INDEX file in directory C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages Gs=tf(100,[1 10]) 错误:在目录 C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages 中找不到任何 INDEX 文件
control-3.2.0, try 'pkg rebuild all' to generate missing INDEX files error: called from describe>parse_pkg_idx at line 94 column 5 describe at line 59 column 40 pkg at line 555 column 43 unimplemented >check_package at line 540 column 15 unimplemented at line 127 column 11 control-3.2.0, try 'pkg rebuild all' to generate missing INDEX files error: called from describe>parse_pkg_idx at line 94 column 5 describe at line 59 column 40 pkg at line 555 column 43未实现>check_package at line 540 column 15 unimplemented在第 127 行第 11 列

In the octave terminal, type八度音程终端中,键入

pkg load control

To load the control package. If you do not already have the control package installed, you need to install it.要加载控件 package。如果尚未安装控件 package,则需要安装它。 You can do so directly from Octave Forge by typing您可以通过键入直接从Octave Forge执行此操作

pkg install -forge control

Note that this will install this package in your predefined 'prefix'.请注意,这会将此 package 安装在您预定义的“前缀”中。 You can find where that is by typing您可以通过键入找到它的位置

pkg prefix

If you're not sure if you have the control package installed, you can check the list of already installed packages by typing如果您不确定是否安装了control package,您可以通过键入来检查已安装包的列表

pkg list

Type help pkg to see more details about how octave's package manager works.键入help pkg以查看有关 Octave 的 package 管理器如何工作的更多详细信息。


In any case, the tf function belongs to the control package, and like all packages, you need to load it before you can use its functions.无论如何, tf function 属于control package,和所有包一样,您需要加载它才能使用它的功能。

Having said this, even after loading the control package, your above code doesn't work.话虽如此,即使在加载控件 package 之后,您的上述代码也不起作用。 It seems like you're calling the tf function using the wrong format.似乎您使用错误的格式调用tf function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM