MATLAB: Identify dependencies for a script on MATLAB

dependenciesdependencyMATLABreportscript

I currently have multiple scripts and when I run a specific script among those, I receive an error that says 'Undefined variable or function'. I would like to identify the dependencies for this script so that I can gather all the required data before running it.

Best Answer

Below are a couple of ways to determine dependencies for a script on MATLAB:
  • Before you begin this step, please ensure that all the necessary script files are placed in one folder and this folder is your current working directory. On the window that displays all the files and folders in the current working directory, there is a blue tab on the top that says 'Current Folder' and has a downward arrow (refer attached image). Please click on this arrow, select Reports ---> Dependency Report. This will provide you with a list of all dependencies of the files present in the current working directory.
  • Alternatively, you can also refer to the documentation in the following link for other methods to identify program dependencies:
                  <http://www.mathworks.com/help/matlab/matlab_prog/identify-dependencies.html?s_tid=srchtitle>
The above two steps should help you resolve the issue.