MATLAB Function Reference |
List dependencies of M-file or P-file
Syntax
list = depfun('fun'); [list, builtins, classes] = depfun('fun'); [list, builtins, classes, prob_files,unused
,unused
,... called_from, java_classes] = depfun('fun'); [...] = depfun('fun1', 'fun2', ...); [...] = depfun({'fun1', 'fun2', ...}); [...] = depfun('fig_file'); [...] = depfun(..., '-toponly');
Description
The depfun
function lists the paths of all files a specified M-file or P-file needs to operate.
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.
[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,...
creates additional cell arrays or structure arrays containing information about any problems with the
called_from, java_classes] = depfun('fun')
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:
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
}
:
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(...,
modifies the options
)
depfun
operation according to the options
specified (see table below).
Examples
list = depfun('mesh'); % Files mesh.m depends on list = depfun('mesh','-toponly') % Files mesh.m depends on directly [list,builtins,classes] = depfun('gca');
See Also
depdir | det |
© 1994-2005 The MathWorks, Inc.