Updated 7 Dec 2016
plot_subfun('foo.m') plots a node map of the subroutines in the file foo.m, and their dependencies.
The screenshot is a sample output for the function plot_subfun.m itself.
There is a demo of examples which can be shown with web(publish('demo_subfun'))
Christopher Pedersen (2023). plot_subfun (https://www.mathworks.com/matlabcentral/fileexchange/46070-plot_subfun), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: farg: a pedestrian M-file parser showing all used functions' syntax, fdep: a pedestrian function dependencies finder, ftoc (v1.2), MATLAB GraphViz Layout importer, GraphViz-like tools for MATLAB
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Fixed bug i unhide code (Thanks Amro).
Fixed bug in plot_graph where node comments appeared in the wrong node. With thanks to Zi-Xiang WANG for spotting the bug.
Added graceful handling of files-not-found, class definitions and scripts when using the -extsub option.
added catch code to handle calls to built-in functions
added -extsub option to recursively find all subroutines in external functions too.
Corrected error : wrong file uploaded
added option to show external function calls in the figure
bugfix to work under 32-bit windows
bugfix in plot_graph line 202 : apparently old syntax didn't work on all windows versions.
added -unhide option to show hidden function in grey
bugfix that handles built-in functions, and functions with no subroutines.
added extra options for selectively hiding subroutines.
Added handling of scripts and function without subroutines.
Changed to matlab toolbox format
bugfix : plot_graph was not working on older versions of matlab under windows.
bugfix to correctly handle multiple subroutines with the same name.
small update to plot_graph
Added handling of files without subroutines