Create Templates for Standard Project Settings
Using Templates to Create Standard Project Settings
In a project, use templates to create and reuse a standard project structure. Templates help you make consistent projects across teams. You can use templates to create new projects that:
Use a standard folder structure.
Set up a company standard environment, for example, with company libraries on the path.
Have access to tools such as company Model Advisor checks.
Use company standard startup and shutdown scripts.
Share labels and categories.
You can use templates to share information and best practices. You or your colleagues can create templates.
Create a template from a project when it is useful to reuse or share with others. You can use the template when creating new projects.
Create a Template from the Current Project
In a project, when you create a template, it contains the structure and all the contents of the current project, enabling you to reuse scripts and other files for your standard project setup. You can choose whether to include the contents of referenced projects in the template.
Before creating the template, create a copy of the project, and edit the copy to contain only the files you want to reuse. Use the copy as the basis for the template.
If the project is under version control, see instead Create a Template from a Project Under Version Control.
On the Project tab, in the File section, select Share > Simulink® Template.
On the Create Project Template dialog box, edit the name and author, select or create a group, and add a description to help template users.
If you have referenced projects and want to export the referenced project files, then select the Include referenced projects check box.
Click Save As. Choose a file location and click Save.
Create a Template from a Project Under Version Control
To avoid accidentally committing changes to your project meant only for the template, stop using source control with this sandbox as you work on the template. In the Source Control view, under Available Source Control Integrations, select
No Source Control Integrationand click Reload.
Remove the files that you do not want in the template. For example, you might want to reuse only the utility functions, startup and shutdown scripts, and labels. In the Files view, right-click unwanted files and select Remove from Project.
On the Project tab, in the File section, select Share > Simulink Template and use the dialog box to name and save the file.
To verify that your template behaves as you expect, create a new project that uses your new template. See Create a New Project Using Templates.
Edit a Template
Create a new project that uses the template you want to modify. See Create a New Project Using Templates.
Make the changes.
On the Project tab, in the File section, select Share > Simulink Template.
Use the dialog box to create a new template or overwrite the existing one.
Remove a Template
To remove a template from the Simulink start page:
Browse to the template location specified in the template details.
Delete the template or move it to another location.
Explore the Example Templates
You can use the example templates as example structures for a new project.