depfun recursion for complete list of functions

조회 수: 16 (최근 30일)
matuser123
matuser123 2016년 4월 8일
답변: Daniel Frisch 2020년 11월 13일
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
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
Image Analyst 2016년 4월 13일

Daniel Frisch
Daniel Frisch 2020년 11월 13일
This function copies all dependencies into a single folder:
copy_dependencies('my_script.m', 'target_folder')

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by