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

To open this script, enter this command in the MATLAB command prompt:

openExample('simulink/SetupAFileManagementSystemExample')

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

Performing a dependency analysis shows that the MATLAB scripts and function are being run by model callbacks.

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

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

Related Topics