MATLAB中未定义的函数

编程入门 行业动态 更新时间:2024-10-20 16:19:28
本文介绍了MATLAB中未定义的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在最新的MATLAB版本中使用函数dtw,并且想调整它的几个部分。为了开始,我输入了:

编辑dtw

我将结果代码保存到名为dtw_Copy.m的文件中,并将函数的名称更改为 dtw_Copy 。使用一系列输入参数 x 和 y 在第90行附近遍历代码:

[metric,varargin] = getmutexclopt({'absolute','euclidean','squared','symmkl'},'euclidean' ,varargin);

我收到一条错误消息:

对于'cell'类型的输入参数,未定义的函数'getmutexclopt'。

我也收到此错误消息如果我没有逐行浏览代码,并且在再次测试一组输入参数 x之后键入 dtw_Current(x,y) 和 y 。

运行时:

help'getmutexclopt'

它是表示找不到 getmutexclopt 。我也试过:

编辑'getmutexclopt'

但我被告知currentDirectory / getmutexcloptm.m不存在。

我试过了:

which getmutexclopt

我被告知找不到 getmutexclopt 。

在线搜索时,发现一个看起来很简单的资源,以排除这个错误。该资源建议确保安装工具箱。我不确定哪个工具箱支持函数 getmutexclopt ,因此我在网站。这会产生一条消息:您的搜索 - getmutexclopt - 与任何文档都不匹配。

该资源还建议验证用于访问该函数的路径。我按照指示操​​作,当我输入时:

which -all getmutexclopt

我收到:

currentDirectory \ matlab\toolbox\signal\signal\private\getmutexclopt.m%私信号给

这似乎表明函数在信号工具箱中,这是私人的?是否有可能仍然运行 dtw_Current(x,y)和/或逐行运行其内容?

是的,这个问题是因为函数 getmutexclopt 是一个私人功能。如果您希望从 dtw 的副本中安全地调用该函数,则需要制作该函数的副本。它似乎是一个基本功能(在命令窗口中键入 edit private / getmutexclopt.m ),因此您可以将它作为子函数添加到 dtw_Copy / dtw_Current 。

另见这个问题 - 不允许在搜索路径中添加私有函数。

I using the function dtw in the latest MATLAB release, and would like to tweak a few parts of it. To get started, I typed:

edit dtw

I saved the resulting code to file called dtw_Copy.m, and changed the name of the function to dtw_Copy as well. Going through the code line by line with a set of input parameters x and y, around line 90:

[metric, varargin] = getmutexclopt({'absolute','euclidean','squared','symmkl'},'euclidean',varargin);

I receive an error message:

Undefined function 'getmutexclopt' for input arguments of type 'cell'.

I also get this error message if I do not go through the code line by line, and simply type dtw_Current(x,y), after again testing a set of input parameters x and y.

Upon running:

help 'getmutexclopt'

it is indicated that getmutexclopt is not found. I tried also:

edit 'getmutexclopt'

But am told that currentDirectory/getmutexcloptm.m does not exist.

I tried:

which getmutexclopt

And am told that getmutexclopt is not found.

Searching online, I found a resource that seemed straight-forward in trouble-shooting this error. The resource recommends to ensure the toolbox is installed. I am unsure which toolbox supports the function getmutexclopt, and so I type the function name into the website. This results in a message that: "Your search - getmutexclopt - did not match any documents."

The resource also recommends verifying the path used to access the function. I followed the instructions to do so, and when I typed:

which -all getmutexclopt

I receive:

currentDirectory\matlab\toolbox\signal\signal\private\getmutexclopt.m % Private to signal

This seems to indicate that the function is in the signal toolbox, which is private? Is there a possibility to still run dtw_Current(x,y) and/or to run its contents line by line?

解决方案

Yes, this issue is because the function getmutexclopt is a private function. You'll need to make a copy of that function if you hope to safely call it from your copy of dtw. It appears to be a basic function (type edit private/getmutexclopt.m in your Command Window) so you may be able to add it as a sub-function to your dtw_Copy/dtw_Current.

See also this question – adding private functions to the search path is not allowed.

更多推荐

MATLAB中未定义的函数

本文发布于:2023-11-28 06:59:49,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   中未   定义   MATLAB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!