wrapper for depfun that plots the results to a node graph of dependencies
faster than regular depfun due to using multiple calls with the -toponly option.
Christopher Pedersen (2021). plot_depfun (https://www.mathworks.com/matlabcentral/fileexchange/46080-plot_depfun), MATLAB Central File Exchange. Retrieved .
Inspired by: fdep: a pedestrian function dependencies finder, MATLAB GraphViz Layout importer, GraphViz-like tools for MATLAB
Inspired: Plot the structure of your structure.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
This should be a built-in - very useful!
Great stuff, recommended.
Very good !
Very cool tool, thank you. To graph all the functions in a same directory I just create a file -with the directory name- in which I just list them all. Is there a smarter way to get the same result ?
I've downloaded my fair share of code from File Exchange, but this worked right out of the box - fast, gorgeous plot, and oh so informative. Someday I hope to be as useful a contributor as you have been. Many thanks!
Simple to use. Works well in R2018b
I meant @Bruce
@Christopher : I was wondering the same. Seems like the blue color means that the functions are located in the same folder than the function foo, and red when it's in a different folder
This worked amazingly for me. Thank you.
Brilliant
very useful!
great tool;
Excellent
What do the colors in the plot signify?
Any way to get toolbox usage included?
Thanks for the feedback - I have updated the file and it should now be working with both edge and node comments.
Great tool.
I used the "-comments" option of plot_graph and noticed they mismatched the "names" input.
Happened to find a bug at line 413, and corrected if by replacing :
set(h,'String',{get(h,'String'),opt.comments{i}})
with :
set(h,'String',{get(h,'String'),opt.comments{ opt.node(i).index }})
so as to get the comments in the right order.
Hope it will be included in the next version!
Regards,
Zi-Xiang
I've tried to explain here http://tdalon.blogspot.de/2016/09/matlab-editor-customized-shortcuts.html how to integrate the utility in the MATLAB Editor by adding a Shortcut in the Quick Access Toolbar. Maybe you can incorporate this improvement.
Can plot_depfun and plot_subfun be integrated?
Thanks for the feedback, John.
I'm guessing that the input to plot_graph is wrong for some reason. Could you put a "keyboard" command on the second line of plot_graph and check the inputs ? they should be:
names = {'plot_depfun','plot_graph'}
from = 1;
to = 2;
varargin = {'-colour','bb'}
Also, for the record I assume you're using windows ?
Regards,
Chris Pedersen
I'm using R2016a and getting the following error:
>> plot_depfun('plot_depfun')
Error using plot_graph>sub_opt (line 37)
unknown options: must be string or cellstring array
This happens on the first iteration of i (line 33), and val = varargin{i} = [3 2].
Do you have any suggested fixes for this?
GREAT!!
This looks like a nice program, but I have not gotten it to work yet. How do I troubleshoot the program when it lands on a "keyboard" command, e.g. on line 241 of plot_graph.m?
Thanks works great now
Hi Bruce - the reason you got this file instead is simple. I'm an idiot and uploaded the wrong file over at plot_subfun. That should now be fixed. As to your question:
A simple example is: plot_depfun('plot_depfun'), which plots the dependecy tree of the function plot_depfun itself. In this case, you will get a figure with two boxes: plot_depfun, and plot_graph, the only other function it depends on.
as to additional inputs, if you type:
plot_depfun('somefunction','a','b','c') you will get the dependency tree for "somefunction", but the functions a,b,c will be ignored (it will be treated as if the function has no dependencies on a,b or c.)
The list of functions to ignore has to be strings. They can be full filenames (e.g. 'c:\folder\somefun.m'), filenames (e.g. 'somefun.m') or just function names (e.g. 'somefun').
Hope that helps.
For some reason I got this function when I tried to download its cousin, plot_subfun (?), but this one looks good, too. Some documentation would be a big help, though. Are there any examples? What inputs are allowed in the varargin input? Options? This looks like a great tool - I just need a few hints. Thanks!
@Marco - thanks for the feedback. I've fixed the bug that wasn't ignoring functions correctly. Let me know if the latest version works for you.
very nice, but the ignoring of the functions in varargin seems not to be working.
No longer errors on simple test case.
>> plot_depfun('plot_depfun')
Matthew - thank you for the feedback.
I had accidentally submitted a test version of the code.
Apologies to everyone who has previously downloaded this file, the new version actually works !
Could be a really cool tool. However, there are several errors: E.g., Error in plot_depfun>sub_deps (line 60), Error in plot_depfun>sub_deps (line 78).
The code quality is fairly poor.