您好,我看到这个命令应该允许查找工具箱依赖项:
matlab.codetools.requiredFilesAndProducts
但是这样的命令还会列出已安装的工具箱,这不是我想要的。 有没有办法找出没有安装但需要执行给定脚本的工具箱?
来自文档
[fList, pList] = matlab.codetools.requiredFilesAndProducts(files)
还返回运行 files 指定的程序文件可能需要的 MathWorks® 产品列表。
If you use the matlab.codetools.requiredFilesAndProducts function on MATLAB code that you received, plist only includes the required toolboxes that are installed on your system. In this case, plist can be incomplete.
因此该命令将列出“必需的”但“已安装”的。
最佳答案
我无法测试它,因为我有所有可用的工具箱,但类似的东西:
[files,plist]= matlab.codetools.requiredFilesAndProducts('myfile');
toolboxRequiredAndMissing(plist);
function toolboxRequiredAndMissing(plist)
v=ver;
for ii=2:length(plist)
found=false;
for jj=1:length(v)
found= strcmp(plist(ii).Name,v(jj).Name);
if found
break
end
end
if (~found)
disp(['Toolbox required and missing: ' plist(ii).Name]);
end
end
end
这不考虑版本。
关于matlab - 如何找到执行 matlab 脚本所需的工具箱(未安装)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51748265/