Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MATLAB查找函数的引用_Matlab_Call - Fatal编程技术网

MATLAB查找函数的引用

MATLAB查找函数的引用,matlab,call,Matlab,Call,MATLAB有一些很棒的工具,其中最突出的就是。我想知道,有没有一种方法可以执行逆运算 也就是说,fList=matlab.codetools.requiredFilesAndProducts(文件)接受一个函数或脚本并返回所有依赖项的列表。我正试图做相反的事情:给定一个函数,我想找到调用该函数的所有函数,可能仅限于我工作目录的范围 我能想到的唯一解决方案是蛮力方法(考虑到matlab.codetools.requiredFilesAndProducts的速度,这将是非常缓慢的)。在MATLAB

MATLAB有一些很棒的工具,其中最突出的就是。我想知道,有没有一种方法可以执行逆运算

也就是说,
fList=matlab.codetools.requiredFilesAndProducts(文件)
接受一个函数或脚本并返回所有依赖项的列表。我正试图做相反的事情:给定一个函数,我想找到调用该函数的所有函数,可能仅限于我工作目录的范围

我能想到的唯一解决方案是蛮力方法(考虑到
matlab.codetools.requiredFilesAndProducts
的速度,这将是非常缓慢的)。在MATLAB类伪代码中:

foi = file of interest
files = empty set of file lists
i = 0;
for all files f in dir
    files{i} = matlab.codetools.requiredFilesAndProducts(f);
    i = i + 1;
end
find indices in files where list contains foi

当然一定有更好的办法。

看看列表中的父母是否是你想要的。它只在当前目录中查找,并且有一些排除项。

我找到的最佳解决方案是使用MATLAB“查找文件”工具(在最新版本中,它是编辑器窗口上的一个按钮)。它实际上非常快,您可以让它搜索目录结构中的所有.m文件,并返回使用特定字符串的每一行,例如,函数名