[英]How to call function that is being shadowed by another one earlier in the MATLAB search path?
By way of preamble, consider this example from Unix. 作为序言,请考虑Unix中的这个例子。 Suppose that
/some/path/foo
and /some/other/path/foo
are both available executables. 假设
/some/path/foo
和/some/other/path/foo
都是可用的可执行文件。 Also, suppose that both /some/path
and /some/other/path
are present in the $PATH
environment variable, with /some/path
appearing first. 另外,假设
$PATH
环境变量中存在/some/path
和/some/other/path
,首先出现/some/path
。 Then, if I run 然后,如果我跑
% foo
the foo
that gets run is /some/path/foo
. 运行的
foo
是/some/path/foo
。 That's what the $PATH
variable is all about. 这就是
$PATH
变量的全部内容。
Nevertheless , I can always invoke the other foo
by referring to it by its full path, like this: 然而 ,我总是可以通过它的完整路径引用它来调用另一个
foo
,如下所示:
% /some/other/path/foo
IOW, once I refer to the command by its full path, no name resolution needs to happen, so $PATH
plays no role in deciding which foo
gets run. IOW,一旦我通过其完整路径引用命令,就不需要进行名称解析,因此
$PATH
在决定运行哪个foo
时不起作用。
Importantly, this mechanism does not require modifiying the $PATH
variable. 重要的是,这种机制不需要修改
$PATH
变量。 One just sidesteps it. 一个人只是回避它。
With this example in mind, does MATLAB provide a way (other than changing the search path) to run a function foo
from a file different from the first candidate file in the MATLAB search path? 考虑到这个例子,MATLAB是否提供了一种方法(除了更改搜索路径之外)从不同于MATLAB搜索路径中第一个候选文件的文件运行函数
foo
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.