updateDependencies
Update project dependencies
Description
updateDependencies(
runs a
dependency analysis on the specified project to update the known dependencies
between project files. After the first dependency analysis, running
proj
)updateDependencies
incrementally updates the
results.
updateDependencies(
specifies additional options as one or more name-value arguments. For example, to
analyze dependencies inside add-ons, set the proj
,Name=Value
)AnalyzeAddOns
argument to true
.
If you change the analysis options, the next time you call
updateDependencies
, a full analysis runs
automatically.
Examples
Update Project Dependencies
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'}
Reanalyze All Project Dependencies
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);
Specify Dependency Analysis Scope
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
proj
— Project
matlab.project.Project
object
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)
ReanalyzeAll
— Option to reanalyze all files in project
false
or
0
(default) | true
or 1
Option to reanalyze all files in the project, specified as a numeric
or logical 1
(true
) or
0
(false
).
Data Types: logical
AnalyzeCCode
— Option to analyze dependencies introduced by C/C++
code files
true
or
1
(default) | false
or 0
Option to analyze dependencies introduced by C/C++
code files, specified as a numeric or logical 1
(true
) or 0
(false
).
Data Types: logical
AnalyzeAddOns
— Option to analyze dependencies inside add-ons
false
or
0
(default) | true
or 1
Option to analyze dependencies inside add-ons, specified as a numeric
or logical 1
(true
) or
0
(false
).
Data Types: logical
AnalyzeModelParameters
— Option to analyze dependencies introduced by MATLAB code in model block parameters
false
or
0
(default) | true
or 1
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
AnalyzeGeneratedCodeTraceability
— Option to analyze dependencies introduced by generated code
false
or
0
(default) | true
or 1
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 R2019aR2024b: Specify dependency analysis scope
Starting in R2024b, you can specify the scope of the dependency analysis.
To analyze dependencies inside add-ons, use
updateDependencies(proj,AnalyzeAddOns=true)
.To analyze dependencies introduced by
C/C++
code files, useupdateDependencies(proj,AnalyzeCCode=true)
.To analyze dependencies introduced by MATLAB code in model block parameters, use
updateDependencies(proj,AnalyzeModelParameters=true)
.To analyze dependencies introduced by code generated from a model, use
updateDependencies(proj,AnalyzeGeneratedCodeTraceability=true)
.
R2024a: Reanalyze all files
Starting in R2024a, you can reanalyze all files in your project and perform a
complete dependency analysis using the
updateDependencies(proj,ReanalyzeAll=tf)
syntax.
See Also
Tools
Functions
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)