Code covered by the BSD License  

Highlights from
dep

Be the first to rate this file! 26 Downloads (last 30 days) File Size: 5.52 KB File ID: #27787
image thumbnail

dep

by Thomas Guillod

 

28 May 2010

Make a dependency report for a matlab file and plot the call graph. Make only static code analysis.

| Watch this File

File Information
Description

Make a dependency report for a matlab file. Plot a dot graph of the result. Independent of the matlab depfun() function. Make only static code analysis.

Independent of the matlab depfun() function.

1) Find the matlab dependency for each matlab file in the directory.
2) Find all the dependency from the main file (recursively).
3) Plot the call graph.

Don't make infinite loop by recursive call.
You can include external function in the call graph.

There is some limitations. The output file is a dot file (graphwiz), so you can fix the error of the script.

Need a unix system.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Show Calling Dependency, fdep: a pedestrian function dependencies finder

MATLAB release MATLAB 7.10 (2010a)
Other requirements Need a Unix system. Use the standard Unix tools like find,grep,sed,...
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
13 Jun 2010 DomDot

Works perfectly for me, thank you very much for this nice piece of software!! I especially am impressed by your parsing of the m files, which is, as you pointed out, rather difficult compared to other languages.

You should add a note that the root m file string must contain the src-folder path as well (obviously it is not deduced from the first string in the dep.m function call), e.g.:
dep('src', 'src/myroot.m', 10, {}, 'fout')

Greetings
Dom

08 Mar 2012 Sam Roberson

Exactly what I have been looking for. Excellent!

Took me a while to find though, which I think may be caused by the misspelling of 'graphwiz'.

Cheers!

Sam

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
directories Thomas Guillod 28 May 2010 09:44:29
function Thomas Guillod 28 May 2010 09:44:29
call Thomas Guillod 28 May 2010 09:44:29
dot Thomas Guillod 28 May 2010 09:44:29
graph Thomas Guillod 28 May 2010 09:44:29
calling Thomas Guillod 28 May 2010 09:44:29
report Thomas Guillod 28 May 2010 09:44:29
dependency Thomas Guillod 28 May 2010 09:44:29
tree Thomas Guillod 28 May 2010 09:44:29
report Christian BARBIER 20 Jun 2011 07:58:02
dependency Alberto Garrido Romero 23 Jun 2011 02:44:27
report Alberto Garrido Romero 23 Jun 2011 02:44:37
graphviz Sam Roberson 08 Mar 2012 08:48:40

Contact us at files@mathworks.com