I am trying to create a function call graph for around 500 matlab src files. I am unable to find any tools which could help me do the same for multiple src files.
Is anyone familiar with any tools or plugins?
In case any such tools are not available, any suggestions on reading 6000 lines of matlab code without documentation is welcome.
I agree with the m2html answer, I just wanted to say the following the example from the m2html/mdot documentation is good:
But I had better luck with exporting to pdf:
Also, before you try the above commands you must issue something like the following:
Let me suggest M2HTML, a tool to automatically generate HTML documentation of your MATLAB m-files. Among its feature list:
Check out this demo page to see an example of the output of this tool.
I recommend looking into using the
depfun
function to construct a call graph. See http://www.mathworks.com/help/techdoc/ref/depfun.html for more information.In particular, I've found that calling
depfun
with the'-toponly'
argument, then iterating over the results, is an excellent way to construct a call graph by hand. Unfortunately, I no longer have access to any of the code that I've written using this.I take it you mean you want to see exactly how your code is running - what functions call what subfunctions, when, and how long those run for?
Take a look at the MATLAB Code Profiler. Execute your code as follows:
p
contains the function history, From that same help page I linked above:You don't necessarily need to display the entrance and exit calls like the above example; just looking at
p.FunctionTable
andp.FunctionHistory
will suffice to show when code enters and exits functions.