Componentize Large Projects
MATLAB supports large-scale project componentization by allowing you to reference
other projects from a parent project. Organizing large projects into components facilitates
code reuse, modular and team-based development, unit testing, and independent release
of components.
Projects can reference multiple other projects in a hierarchical manner. The project
reference hierarchy appears as a tree in the References view.
From a parent project, you can
- Access the project paths, entry-point shortcuts, and source control information for all
referenced projects. - View, edit, and run files that belong to a referenced project.
- Detect changes in referenced projects using checkpoints.
Add or Remove Reference to a Project
You can add new components to a project by referencing other projects.
To add a reference to a project:
1
On the Project tab, in the Environment section, click References. The Add
Reference dialog box opens.
(^2) Browse to select the required project (.prj) file.
(^3) In the Referenced type field, select either Relative or Absolute. Select Relative if
your project hierarchy has a well-defined root relative to your project root. For
example, your project root might be a folder under source control. Select Absolute if
the project you want to reference is in a location accessible to your computer, for
example, a network drive.
(^4) To create a checkpoint when you add the project, select Set a checkpoint to detect
future changes. For more information about checkpoints, see “Manage Changes in
Referenced Project Using Checkpoints” on page 31-27.
(^5) Click Add.
When the referenced project loads, MATLAB adds the referenced project path to the
MATLAB search path and then runs or loads specified startup files. Similarly, when the
Componentize Large Projects