PAUSING on function call - matlab

I have a main matlab script that call functions, that call other functions, etc., etc. about 1000 functions in all.
I did not write it, but I would like Matlab to pause whenever a new function is called, and tell me the name of the function.
My objective is to develop a tree-diagram of all of the functions.
Is there a setting in the debugger, or preferences, anyway to do this automatically?

댓글 수: 4

Fangjun Jiang
Fangjun Jiang 2020년 11월 10일
do you have the source .m code?
Rik
Rik 2020년 11월 10일
There is a built-in dependency analyzer. You could probably also use the output that the profiler gives you.
You can also go another route: parsing your script on your own, using which to find out the file location of a function. You can probably use much of the code I wrote here.
Be aware that you are embarking on a very difficult task, depending on the functions involved.
Rand Dannenberg
Rand Dannenberg 2020년 11월 10일
I have all the matlab scripts and functions as .m files, over 1000 of them...
I am just hoping I do not have to manually go into all the .m files looking for the call, and hope it can be set up to PAUSE on the call of any function.
Rand Dannenberg
Rand Dannenberg 2020년 11월 10일
Rik - thanks, where can I read about the dependency analyzer and profiler?

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 11월 10일
편집: Fangjun Jiang 2020년 11월 10일

0 개 추천

The call of another function might be dependent on a particular condition inside this function. So it is not ideal or practical to watch/debug the actual execution of the M script in one case or a few cases to get the information.
What you are looking for is probably this.

댓글 수: 6

Rand Dannenberg
Rand Dannenberg 2020년 11월 10일
Fangjun - much thanks!
Rand Dannenberg
Rand Dannenberg 2020년 11월 10일
I do not actually see any of the following in my matlab window:
"To start analyzing your project, on the Project tab, in the Tools section, click Dependency Analyzer. Alternatively, in the project Views pane, select Dependency Analyzer and click Analyze."
from the link below...
Where is the Project tab?
Thanks.
Rik
Rik 2020년 11월 10일
Project is not a euphemism for folder. You can find more information here.
Fangjun Jiang
Fangjun Jiang 2020년 11월 10일
Create a new project, add all the scripts the do the analysis
Rand Dannenberg
Rand Dannenberg 2020년 11월 12일
ok, will do. thanks. I gathered it is not the same thing as folder. somehow the project editor is launched and folders and files get put into it which then get analyzed and a tree diagram gets displayed. I will study that and if stuck, write again.
really appreaciate the help!
Rand Dannenberg
Rand Dannenberg 2020년 11월 12일
I got this working. You guys were incredibly helpful. Thank you! Exactly what I needed.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2020년 11월 10일

댓글:

2020년 11월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by