Main Content

updateDependencies

Update project dependencies

Description

updateDependencies(proj) runs a dependency analysis on the specified project to update the known dependencies between project files. After the first dependency analysis, running updateDependencies incrementally updates the results.

example

updateDependencies(proj,Name=Value) specifies additional options as one or more name-value arguments. For example, to analyze dependencies inside add-ons, set the AnalyzeAddOns argument to true.

If you change the analysis options, the next time you call updateDependencies, a full analysis runs automatically.

example

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Update the project dependencies. By default, updateDependencies performs an incremental dependency analysis. For information on reanalyzing all files and performing a complete dependency analysis, see Reanalyze All Project Dependencies.

updateDependencies(proj);

Get the files required by the timestable.mlapp project file.

g = proj.Dependencies;
requiredFiles = bfsearch(g,which("source/timestable.mlapp"))
requiredFiles =

  2×1 cell array

    {'C:\myProjects\examples\TimesTableApp\source\timestable.mlapp'}
    {'C:\myProjects\examples\TimesTableApp\source\timesTableGame.m'}

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Reanalyze all files and perform a complete dependency analysis on your project.

updateDependencies(proj,ReanalyzeAll=true);

Open your project and create a project object.

proj = openProject("myNewProject");

Perform a dependency analysis on your project and include dependencies in add-ons and dependencies introduced by MATLAB® code in model block parameters.

updateDependencies(proj,AnalyzeAddOns=true,AnalyzeModelParameters=true);

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: updateDependencies(proj,ReanalyzeAll=true,AnalyzeCCode=false,AnalyzeAddOns=true)

Option to reanalyze all files in the project, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Option to analyze dependencies introduced by C/C++ code files, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Option to analyze dependencies inside add-ons, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Option to analyze dependencies introduced by MATLAB code in model block parameters, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Option to analyze dependencies introduced by code generated from a model, specified as a numeric or logical 1 (true) or 0 (false).

Analyzing code traceability requires an Embedded Coder® license.

Data Types: logical

Version History

Introduced in R2019a

expand all