Programming Previous page   Next Page

Identifying Dependencies

Most any program you write will make calls to other functions and scripts. If you need to know what other functions and scripts your program is dependent upon, use one of the techniques described below.

Simple Display of M-File Dependencies

For a simple display of all M-files referenced by a particular function, follow these steps:

  1. Type clear functions to clear all functions from memory (see Note below).

  1. Execute the function you want to check. Note that the function arguments you choose to use in this step are important, because you can get different results when calling the same function with different arguments.
  2. Type inmem to display all M-files that were used when the function ran. If you want to see what MEX-files were used as well, specify an additional output:
  1. [mfiles, mexfiles] = inmem

Detailed Display of M-File Dependencies

For a much more detailed display of dependent function information, use the depfun function. In addition to M-files, depfun shows which built-ins and classes a particular function depends on:

Previous page  Types of Functions Function Arguments Next page

© 1994-2005 The MathWorks, Inc.