File Exchange

image thumbnail


version (5.68 KB) by Brett Shoelson
Evaluates dependencies for a function, INCLUDING loaded files, icons, images, etc.

1 Download

Updated 20 Jul 2017

View License

Expands on the dependency analysis results of matlab.codetools.requiredFilesAndProducts by including in the search any files (including images, sounds, icons, datafiles, etc.) loaded, read, queried, etc.
Automatically generates and stores a list of load functions by analyzing the function list of all Toolboxes recognized by requiredFilesAndProducts.
Optionally, checks for copyright; optionally creates a zip file including all dependent (non-MathWorks) files.

Cite As

Brett Shoelson (2020). requiredFiles (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

zmi zmi

Terrance Nearey

Note for better platform independence:
MATLAB path strings need attention as well.
Change getInputFunctionList line 103 from
`allPaths = textscan(allPaths,'%s','delimiter',';')`
allPaths = textscan(allPaths,'%s','delimiter',pathsep())`

Brett Shoelson

Thanks for tracking that down for me--I was having a difficult time finding it. I've submitted a fix for this. The new version should also handle off-path files (requirements) better.

Aurelien Queffurust

@Brett : VER is returning empty when you have the subfolder coder and you do not have MATLAB Coder (idem with simulink , rtw). I have these subfolders in my 16a Prerelease. But as you wrote adding a if-test is the correct fix.

Brett Shoelson

I'm sorry you had such a terrible experience with this tool.

I can readily address the hard-path-delimiter issue; in getInputList.m, simply replace line 111:
fileList = regexprep({}','\.m','');

with this:
fileList = regexprep({}',[filesep,'.m'],'');

But under what conditions is VER returning empty? Third-party Toolboxes? I didn't code to capture those. I suggest following the call to VER (line 97 in getInputFunctionList.m) with this:

if isempty(tmp),continue,end


Oleg Poliannikov

Failed twice on my mac. The first problem is that the path delimiter is hardwired. That I changed manually. The second one is that ver sometimes produces empty outputs, which are not handled correctly. I could not immediately fix this one.

Michael Quinn

This is a very useful utility as it helps you package up code to share with others without having to manually track down all of your helper files that may not reside in the main folder.


Updated license

Updated license

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux