MATLAB Function Reference    
depfun

List the dependent functions of an M-file or P-file

Syntax

Description

The depfun function lists all of the functions and scripts, as well as built-in functions, that a specified M-file needs to operate. This is useful for finding all of the M-files that you need to compile for a MATLAB runtime application.

list = depfun('file_name') creates a cell array of strings containing the paths of all the files that file_name.m uses. This includes the second-level files that are called directly by file_name.m, as well as the third-level files that are called by the second-level files, and so on.

[list,builtins,classes] = depfun('file_name') creates three cell arrays containing information about dependent functions. list contains the paths of all the files that file_name and its subordinates use. builtins contains the built-in functions that file_name and its subordinates use. classes contains the MATLAB classes that file_name and its subordinates use.

[list,builtins,classes,prob_files,prob_sym,eval_strings,...
called_from,java_classes] = depfun('file_name')
creates additional cell arrays or structure arrays containing information about any problems with the depfun search and about where the functions in list are invoked. The additional outputs are:

[...] = depfun('file_name1','file_name2',...) performs the same operation for multiple files. The dependent functions of all files are listed together in the output arrays.

[...] = depfun('fig_file_name') looks for dependent functions among the callback strings of the GUI elements that are defined in the .fig or .mat file named fig_file_name.

[...] = depfun(...,'-toponly') differs from the other syntaxes of depfun in that it examines only the files listed explicitly as input arguments. It does not examine the files on which they depend. In this syntax, the flag '-toponly' must be the last input argument.

Notes

  1. If depfun does not find a file called hginfo.mat on the path, then it creates one. This file contains information about Handle Graphics callbacks.
  2. If your application uses toolbar items from MATLAB's default figure window, then you must include 'FigureToolBar.fig' in your input to depfun.
  3. If your application uses menu items from MATLAB's default figure window, then you must include 'FigureMenuBar.fig' in your input to depfun.
  4. Because many built-in Handle Graphics functions invoke newplot, the list produced by depfun always includes the functions on which newplot is dependent:

Examples

See Also

depdir


 depdir det