| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
list = depfun('fun')
[list, builtins, classes] = depfun('fun')
[list, builtins, classes, prob_files,
prob_sym, eval_strings,... called_from, java_classes] = depfun('fun')
[...] = depfun('fun1', 'fun2',...)
[...] = depfun({'fun1', 'fun2', ...})
[...] = depfun('fig_file')
[...] = depfun(..., options)
The depfun function lists the paths of all files a specified M-file or P-file needs to operate.
Note It cannot be guaranteed that depfun will find every dependent file. Some dependent files can be hidden in callbacks, or can be constructed dynamically for evaluation, for example. Also note that the list of functions returned by depfun often includes extra files that would never be called if the specified function were actually evaluated. |
list = depfun('fun') creates a cell array of strings containing the paths of all the files that function fun uses. This includes the second-level files that are called directly by fun, and the third-level files that are called by the second-level files, and so on.
Function fun must be on the MATLAB path, as determined by the which function. If the MATLAB path contains any relative directories, then files in those directories will also have a relative path.
Note If MATLAB returns a parse error for any of the input functions, or if the prob_files output below is nonempty, then the rest of the output of depfun might be incomplete. You should correct the problematic files and invoke depfun again. |
[list, builtins, classes] = depfun('fun') creates three cell arrays containing information about dependent functions. list contains the paths of all the files that function fun and its subordinates use. builtins contains the built-in functions that fun and its subordinates use. classes contains the MATLAB classes that fun and its subordinates use.
[list, builtins, classes, prob_files, prob_sym, eval_strings,... called_from, java_classes] = depfun('fun') 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
prob_files — Indicates which files depfun was unable to parse, find, or access. Parsing problems can arise from MATLAB syntax errors. prob_files is a structure array having these fields:
name (path to the file)
listindex (index of the file in list)
errmsg (problems encountered)
unused — This is a placeholder for an output argument that is not fully implemented at this time. MATLAB returns an empty structure array for this output.
called_from — Cell array of the same length as list that indicates which functions call other functions. This cell array is arranged so that the following statement returns all functions in function fun that invoke the function list{i}:
list(called_from{i})java_classes — Cell array of Java class names used by fun and its subordinate functions.
[...] = depfun('fun1', 'fun2',...) performs the same operation for multiple functions. The dependent functions of all files are listed together in the output arrays.
[...] = depfun({'fun1', 'fun2', ...}) performs the same operation, but on a cell array of functions. The dependent functions of all files are listed together in the output array.
[...] = depfun('fig_file') looks for dependent functions among the callback strings of the GUI elements that are defined in the figure file named fig_file.
[...] = depfun(..., options) modifies the depfun operation according to the options specified (see table below).
Option | Description |
|---|---|
'-all' | Computes all possible left-side arguments and displays the results in the report(s). Only the specified arguments are returned. |
'-calltree' | Returns a call list in place of a called_from list. This is derived from the called_from list as an extra step. |
'-expand' | Includes both indices and full paths in the call or called_from list. |
'-print', 'file' | Prints a full report to file. |
'-quiet' | Displays only error and warning messages, and not a summary report. |
'-toponly' | Examines only the files listed explicitly as input arguments. It does not examine the files on which they depend. |
'-verbose' | Outputs additional internal messages. |
list = depfun('mesh'); % Files mesh.m depends on
list = depfun('mesh','-toponly') % Files mesh.m depends on
directly
[list,builtins,classes] = depfun('gca');![]() | depdir | det | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |