Main Content

Set Up a File Management System

As a model grows, managing referenced files and dependencies becomes more complicated. To reduce the complexity of managing large models, you can use projects. Projects in Simulink help to organize large model hierarchies by finding required files, managing and sharing files and settings, and interacting with source control.

MATLAB® script ex_modeling_project_setup.m creates a project that contains these files:

  • Subsystem file ex_modeling_mechanical_system.slx

  • Model file ex_modeling_variants.slx

  • Model file ex_modeling_controller.slx

  • Model file ex_modeling_operator_variant.slx

  • MATLAB script ex_modeling_data_mechanical_system.m

  • MATLAB script ex_modeling_data_controller.m

  • MATLAB script ex_modeling_variant_choice.m

  • MATLAB function ex_modeling_bus_objects.m

Run the script to create the project.

The MATLAB scripts and function are configured to Run at Startup.

Using this project, you can explore project capabilities, such as these capabilities:

  • Automate tasks

  • Create shortcuts for common actions

  • Analyze file dependencies

  • Analyze the impact of changing files

  • Compare model files

In the Project Views, select Dependency Analyzer and click Analyze to run a dependency analysis on all the files in your project. In the dependency graph, hover over the dependency arrows to find the dependency type. It shows that the MATLAB scripts and functions are being run by model callbacks.

Since these files now run at startup, the model callbacks are redundant and can be removed.

The dependency graph also shows the two-level model hierarchy, in which the top model depends on a library and referenced model.

Related Topics