5.0

5.0 | 7 ratings Rate this file 157 downloads (last 30 days) File Size: 272.19 KB File ID: #17291

fdep: a pedestrian function dependencies finder

by us

 

01 Nov 2007 (Updated 18 Jun 2009)

Code covered by BSD License  

FDEP dissects ML files and iteratively looks for all user defined functions used during runtime

Download Now | Watch this File

File Information
Description

FDEP dissects MATLAB files and iteratively looks for all user defined functions (modules), which are used during runtime

FDEP retrieves for each module its
- subfunctions
- nested functions
- anonymous functions
- eval class calls
- unresolved calls
    and all
- ML stock functions
- ML built-in functions
- ML classes
- ML toolboxes
    that it uses

runtime options and returned macros create user-friendly,
intuitively comprehensible, and interactive GUIs, which
- list the results in various panels and listboxes
- plot a full synopsis for each module with
exhaustive information
- plot a full dependency matrix
- plot a runtime and modules tree

in essence, FDEP is a wrapper for DEPFUN and MLINT; however, due to an efficient pruning engine it is considerably (20-100 times!) faster

FDEP is particularly useful if you want to distribute your functions and need so see what else to include as well as the toolboxes they use

FDEP may be useful to debug an erroneous function with correct syntax

see
> help fdep
and the accompanying published M-file for help and an exhaustive example

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
farg: a pedestrian M-file parser showing all used functions' syntax
This submission has inspired the following:
ftoc (v1.2)

MATLAB release MATLAB 7 (R14)
Other requirements optimized for R2009a
Zip File Content  
Published M Files fdephtml
Other Files
fdep.m,
hfdep/fdephtml.png,
hfdep/fdephtml_01.png,
hfdep/fdephtml_02.png,
hfdep/fdephtml_03.png,
hfdep/fdephtml_04.png,
hfdep/fdephtml_05.png,
hfdep/fdephtml_06.png,
hfdep/fdephtml_07.png,
hfdep/fdephtml_08.png,
hfdep/fdephtml_09.png,
hfdep/fdephtml_10.png,
hfdep/fdephtml_11.png,
license.txt,
tfdep1.m,
tfdep2.m,
tfdep3.m,
tfdep4.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (18)
03 Nov 2007 The empror of Matlab

wow!

06 Nov 2007 Caroline Herbst

Extremely helpful, indeed! Also, the author did very quickly add a new feature after a pleasant email exchange.

07 Nov 2007 John D'Errico

As always, a fully featured, fully able tool from us. Well done.

I do have one comment - my older eyes had a moderately hard time with the tiny font size and color scheme in the resulting gui. Pastel colored text on a pastel background was hard to read. Time for a new prescription in my glasses?

07 Nov 2007 urs (us) schwarz

to accommodate FDEP to JD's eyesight, an upgrade was just uploaded with these changes

1) candy colors were moved towards zero (still hoping that they group the various panels quickly for the eye...)

2) a JOHN D' button was added; its help section says:
utility in honor of John D'errico, a senior and most respected
   FEX and CSSM contributor, with very poor eyesight
CLICKING on the button will grow the fontsize by 1 point every time

the version tag is 07-Nov-2007 21:10:00
us

13 Nov 2007 Andrew Walton

It falls over when mex files are used.

13 Nov 2007 Urs (us) Schwarz

andrew, can you get in touch with me?unfortunately, you didn't provide an email address.

25 Jan 2008 exfnjbdr exfnjbdr

 [URL=http://fxbpibjx.com]guupplld[/URL] <a href="http://hjnyyjjr.com"&gt;jmtcnixm&lt;/a&gt; zshmaoig http://spqkqjpu.com jqpjujjw apsdptbx

10 Jan 2009 Image Analyst

I just downloaded it and it looks very nice. However I'd like you to fix the bug where it's locating the wrong module. I have a main module and it calls 8 other modules, 7 of which are in the same folder as the main module. However, module #2 you list as being one of the same name that I happen to have in another folder. I'm not sure why you're seeing that one first - MATLAB doesn't, it sees and runs the proper one which is in the same module as the main module. For example, in folder1, I have m-files myFile and mySubFile1, mySubFile2, etc. But in folder2, there is also a mySubFile1 and this is the one that your program is finding instead of the mySubFile1 in folder1.

A few more suggestions on the list GUI:
1. Replace the [John D'] button with a scroll bar or two small buttons to increase and decrease the font size.
2. I'd also like to see tooltips on your 6 buttons (right off the bat, it's not obvious what some of them do).
3. I'd like it to start with a GUI rather than a 2-steps command line process.
4. The Image Processing Toolbox is incorrectly called "images" in the toolboxes listbox.
5. A longer and more descriptive name than the short and cryptic "fdep" would be nice. And what does "pedestrian" have to do with it? Is that word needed?

Here's what MATLAB reports for my toolboxes:
MATLAB Version 7.7 (R2008b)
Image Processing Toolbox Version 6.2 (R2008b)
MATLAB Builder NE Version 3.0 (R2008b)
MATLAB Compiler Version 4.9 (R2008b)
Signal Processing Toolbox Version 6.10 (R2008b)
ToolBox EXAMPLE_SCRIPTS Version 1.0.0

Just my 2 cents on a well done program.

27 Feb 2009 Yuri Kotliarov

Great function! Very useful. Is it possible to see also other files required in a package, like mat, txt, ini, etc?

28 Feb 2009 Jveer

very nice. thank you for sharing this very useful too

07 Jun 2009 Alon

This is a great idea, implemented in a great way!
Full of user-fraindly and usefull features.

Great job.

08 Jun 2009 us

with the latest version (08-Jun-2009 22:24:13/R14-R2009a), per isakson's error messages do not show anymore...
the reason was an old parser engine, which did not handle more recent function constructs...
thanks, per, for alerting me to this problem...
us

17 Jun 2009 Andreas

I liked the previous version very much! Thanks a lot.

The latest version has a bug. If a sealed class (e.g. with a definition "classdef (Sealed) MyClass") is analyzed, the program crashes in fdep on line 2928. If "(Sealed)" is removed the program works as advertised.

27 Jul 2009 Jason

For being as full-featured as it appears, why will this function not accept full path names?

fdep('C:\blah\blah\blah\file.m')

I get an error saying "file not found". It only seems to work with files in current directory or in the MATLAB path.

27 Jul 2009 us

jason

yes, this is by design...
while it could easily be changed, it also (potentially) would lead to undesirable results...
thus, to FDEP a file residing in a folder, which is not in ML's path, you must CD into that folder...
however, let me know if this is a real problem for you, as it certainly can be changed...

us

13 Aug 2009 Dirk

Thanks for this fantastic tool. The speed-up compared to depfun is amazing.

Though there is one feature I am missing somewhat:
 fdep lets you identify which toolboxes are used from _somewhere_ in you code easiliy. But unfortunately it is not so easy to identify which of my .m files caused this toolbox dependency.
What would be great would be a possibilty to, e.g. select one of the toolboxes in the list-view which in turn could highlights all modules that directly depend on the selected tool box.

13 Aug 2009 us

hi dirk
great suggestion for an enhancement!...
i built a helper function, which does what you need and will email it to you if you want...
it will become part of FDEP as soon as i can get to it...
us

05 Nov 2009 Jonas

Excellent function!

In Windows, the file separators in output.froot point the wrong way, though. Is that on purpose?

Please login to add a comment or rating.
Updates
02 Nov 2007

added an option to display full contents of a module; removed an annoying typo; version tag is 02-Nov-2007 15:34:23

02 Nov 2007

the wrong zip was submitted! sorry. version tag 02-Nov-2007 17:47:40

02 Nov 2007

upload did not seem to work?! last try... version tag 02-Nov-2007 19:36:43

05 Nov 2007

user requests: added more functionality to several macros; added a section on how FDEP might help to debug an erroneous function with correct syntax; version tag 05-Nov-2007 03:55:35

06 Nov 2007

again, the latest upload caused a mix-up of newer and older files on the FEX(?) - this has been a real problem as of lately; version tag 05-Nov-2007 17:32:49

08 Nov 2007

changes to accomodate john d'errico: 1) moved candy colors towards white, 2) added a JOHN D' button to increase the font size by one point for every click... version tag 07-Nov-2007 21:10:00

12 Nov 2007

user requests: FDEP now dissects standalone as well as M-file associated P-files; changes in the module's full synopsis display; many more examples in the HTML file; version tag 11-Nov-2007 01:01:25

14 Nov 2007

now handles MEX/DLL and MDL files as well; version tag 14-Nov-2007 13:16:06

14 Jul 2008

floating button list for main tasks; vastly enhanced module synopsis window contents and functionality; new window manager to easily find a FDEP associated window and bring it to the top; enhanced help module; version tag 11-Jul-2008 18:28:12

08 Jun 2009

added a runtime/modules tree display, more information in the module synopsis, new macros, version tag 08-Jun-2009 22:24:13

18 Jun 2009

the parser now accepts meta method class descriptors, which takes care of Andreas's problem; version tag 18-Jun-2009 09:41:57

Tag Activity for this File
Tag Applied By Date/Time
path us 22 Oct 2008 09:33:34
directories us 22 Oct 2008 09:33:34
files us 22 Oct 2008 09:33:34
function us 22 Oct 2008 09:33:34
depfun us 22 Oct 2008 09:33:34
mlint us 22 Oct 2008 09:33:34
anonymous us 22 Oct 2008 09:33:34
nested us 22 Oct 2008 09:33:34
class us 22 Oct 2008 09:33:34
builtin us 22 Oct 2008 09:33:34
syntax us 08 Jun 2009 16:54:59
parser us 08 Jun 2009 16:54:59
lexical us 08 Jun 2009 16:54:59
calls us 08 Jun 2009 16:54:59
unresolved us 08 Jun 2009 16:54:59
nested Ethan 15 Jun 2009 07:46:24
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com