There are a couple of different ways to do that:
1) Mathworks has a number of different dependency analyzers. Here's instructions on one for project dependencies
2) Here's instructions on how to use the folder dependency report feature
3) I personally tend to do things programatically, so I use the code tools Required Productions and Files method
Here's one example of how to use #3 (credit goes to the author of the fEx linked below)
Dep_List = matlab.codetools.requiredFilesAndProducts(SRC);
IN_matlab = strncmp(matlabroot, Dep_List, length(matlabroot));
Dep_List = Dep_List(~IN_matlab);
An out of date method is to use "depfun", but that will not work in more recent Matlab versions. depfun is used in the below fEx, but I've personally had success in the task you're looking to perform by adapting this fEx to work with the more up to date methods.
To use it, you have to update the method, and then the old method put the parent file at the top of the dependency list while the new methods put it somewhere else, so you have to compensate for that in the processing.