Main Content

listRequiredFiles

Get files required by specified project files

Since R2019a

Description

example

requiredfiles= listRequiredFiles(proj,files)returns the names of the project files that the specified files require to run.

Examples

collapse all

Open the Times Table App project. UsecurrentProjectto create a project object.

matlab.project.example.timesTable proj = currentProject;

Get the files required by the Times Table app file.

file ="source/timestable.mlapp"requiredfiles = listRequiredFiles(proj,file);
requiredfiles = 2×1 string array "C:\myProjects\examples\TimesTableApp\source\timestable.mlapp" "C:\myProjects\examples\TimesTableApp\source\timesTableGame.m"

Input Arguments

collapse all

Project, specified as amatlab.project.Projectobject. UsecurrentProjectto create a project object from the currently loaded project.

Path of project files including file extensions, specified as a cell array of character vectors, a string array, or aProjectFileobject array. Specifyfilesas absolute file paths or paths relative to the project root folder. The files must be within the project root folder.

Output Arguments

collapse all

需要的项目文件,回报ned as a string array.

Version History

Introduced in R2019a