MATLAB 中的未定义函数
Undefined function in MATLAB
我在最新的 MATLAB 版本中使用函数 dtw,并想调整其中的几个部分。首先,我输入了:
edit dtw
我将生成的代码保存到名为 dtw_Copy.m 的文件中,并将函数的名称也更改为 dtw_Copy
。使用一组输入参数 x
和 y
逐行查看代码,大约在第 90 行:
[metric, varargin] = getmutexclopt({'absolute','euclidean','squared','symmkl'},'euclidean',varargin);
我收到一条错误消息:
Undefined function 'getmutexclopt' for input arguments of type 'cell'.
如果我没有逐行查看代码,而是简单地键入 dtw_Current(x,y)
,在再次测试一组输入参数 x
和 [=19= 之后,我也会收到此错误消息].
在 运行宁:
help 'getmutexclopt'
表示没有找到getmutexclopt
。我也试过了:
edit 'getmutexclopt'
但是我被告知 currentDirectory/getmutexcloptm.m 不存在。
我试过了:
which getmutexclopt
我被告知找不到 getmutexclopt
。
网上搜索,我找到了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。这会导致一条消息:"Your search - getmutexclopt - did not match any documents."
该资源还建议验证用于访问函数的路径。我按照说明进行操作,当我输入:
which -all getmutexclopt
我收到:
currentDirectory\matlab\toolbox\signal\signal\private\getmutexclopt.m % Private to signal
这好像是信号工具箱里面的函数,是private的?是否有可能仍然运行 dtw_Current(x,y)
and/or 到 运行 其内容逐行?
是的,这个问题是因为函数 getmutexclopt
是一个 private function。如果您希望从 dtw
的副本中安全地调用它,则需要复制该函数。它似乎是一个基本功能(在您的命令 Window 中键入 edit private/getmutexclopt.m
),因此您可以将它作为子功能添加到您的 dtw_Copy
/dtw_Current
。
另见 this question – 不允许将私有函数添加到搜索路径。
我在最新的 MATLAB 版本中使用函数 dtw,并想调整其中的几个部分。首先,我输入了:
edit dtw
我将生成的代码保存到名为 dtw_Copy.m 的文件中,并将函数的名称也更改为 dtw_Copy
。使用一组输入参数 x
和 y
逐行查看代码,大约在第 90 行:
[metric, varargin] = getmutexclopt({'absolute','euclidean','squared','symmkl'},'euclidean',varargin);
我收到一条错误消息:
Undefined function 'getmutexclopt' for input arguments of type 'cell'.
如果我没有逐行查看代码,而是简单地键入 dtw_Current(x,y)
,在再次测试一组输入参数 x
和 [=19= 之后,我也会收到此错误消息].
在 运行宁:
help 'getmutexclopt'
表示没有找到getmutexclopt
。我也试过了:
edit 'getmutexclopt'
但是我被告知 currentDirectory/getmutexcloptm.m 不存在。
我试过了:
which getmutexclopt
我被告知找不到 getmutexclopt
。
网上搜索,我找到了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。这会导致一条消息:"Your search - getmutexclopt - did not match any documents."
该资源还建议验证用于访问函数的路径。我按照说明进行操作,当我输入:
which -all getmutexclopt
我收到:
currentDirectory\matlab\toolbox\signal\signal\private\getmutexclopt.m % Private to signal
这好像是信号工具箱里面的函数,是private的?是否有可能仍然运行 dtw_Current(x,y)
and/or 到 运行 其内容逐行?
是的,这个问题是因为函数 getmutexclopt
是一个 private function。如果您希望从 dtw
的副本中安全地调用它,则需要复制该函数。它似乎是一个基本功能(在您的命令 Window 中键入 edit private/getmutexclopt.m
),因此您可以将它作为子功能添加到您的 dtw_Copy
/dtw_Current
。
另见 this question – 不允许将私有函数添加到搜索路径。