File Exchange

image thumbnail

requiredFiles

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

2 Downloads

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.

Comments and Ratings (7)

zmi zmi

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

@Aurelien:
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.
Cheers,
Brett

@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.

@Oleg:
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({fileList.name}','\.m','');

with this:
fileList = regexprep({fileList.name}',[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

Brett

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.

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.

Updates

1.0.0.1

Updated license

1.2.0.1

Updated license

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