depfun recursion for complete list of functions
10 次查看(过去 30 天)
显示 更早的评论
I am trying to find all dependent functions for a given project using 'depfun' and recursion. I have an idea of how to do this but I'm missing how to collect the full list of functions. Any ideas? I've searched but not found anything similar that works.
function list = depfunRec(list)
if isempty(list)
return
end
list = depfun(list,'-quiet');
keepIx = cellfun(@isempty,strfind(list,list{1})); % do not repeat search for first entry
keepIx = keepIx & cellfun(@isempty,strfind(list,'MATLAB'));
list = list(keepIx);
list = depfunRec(list);
end
1 个评论
sam0037
2016-4-13
Hi,
You can refer to the following documentation links to know more about identifying program dependencies:
Additionally, it would help to troubleshoot this better if you could give an example where this depfunRec fails. I would also like you to try putting a debug points wherever 'keepIx' is assigned and check its value. Hope this helps.
回答(2 个)
Image Analyst
2016-4-13
I find this is much more comprehensive: http://www.mathworks.com/matlabcentral/fileexchange/17291-fdep--a-pedestrian-function-dependencies-finder
0 个评论
Daniel Frisch
2020-11-13
This function copies all dependencies into a single folder:
copy_dependencies('my_script.m', 'target_folder')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!