Programming |
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:
clear
functions
to clear all functions from memory (see Note below).
Note
clear functions does not clear functions locked by mlock . If you have locked functions (which you can check using inmem ) unlock them with munlock , and then repeat step 1.
|
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:
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:
[list, builtins, classes] = depfun('strtok.m'); list list = 'D:\matlabR14\toolbox\matlab\strfun\strtok.m' 'D:\matlabR14\toolbox\matlab\graphics\newplot.p' 'D:\matlabR14\toolbox\matlab\graphics\closereq.m' 'D:\matlabR14\toolbox\matlab\ops\@double\any.bi' . . .
Types of Functions | Function Arguments |
© 1994-2005 The MathWorks, Inc.