Main Content

Work with Referenced Projects

This example shows how to use referenced projects as independent components within your project.

The top-level Airframe Example project provides an airframe simulation. To use additional functionalities available in Signal Multiplier and Wind Gust library, the top-level project adds them as referenced projects.

  • The Signal Multiplier referenced project shows how to develop an S-function in a component independent from the top-level project. The referenced project provides source code, build support and path management. The build folder is on the project path. This ensures it is also on the top-level project path. The project has a Rebuild S-function shortcut.

  • The Wind Gust Library referenced project provides a library and a data dictionary that contains the required bus objects for the library. This project path ensures that the library is set up for use in the top-level project.

How Referenced Projects Work

When you open the top-level project, referenced projects load first. This adds the referenced project paths to the MATLAB search path and runs any startup actions that you specified in the referenced projects.

To access content and run shortcuts in referenced projects from the top-level project, in the References view, select the reference project, for example, Signal Multiplier. In the References tab, in the Shortcut section, click on a shortcut, for example Rebuild S-function.

.

To examine files, labels, and source control status in the referenced projects, in the References view, select the referenced project, and click Show Files. For advanced manoeuvres, you can open the referenced project as a top-level project. In the References tab, click Open Project.

To learn how to create and reference projects programmatically, see Create and Reference a Project Programmatically. To learn how to use Git™ submodules to populate referenced projects, see Organize Projects into Components Using References and Git Submodules. For more information, watch How to Organize Large Projects into Components (3 min, 32 sec).

Related Topics