Create Template from Model - MATLAB & Simulink (original) (raw)
Main Content
Create a SimulinkĀ® template from a model to reuse or share the settings and contents of the model without copying the model each time. Create templates only from models that do not have external file dependencies, for example, model references, data dictionary, scripts, S-functions, or other file dependencies. If you want to include other dependent files, use a project template instead. See Create Templates for Standard Project Settings.
- In the model, on the Simulation tab, select > .
- In the Export
modelname
to Model Template dialog box, edit the template title, select or create a group, and enter a description of the template.
The Simulink Start Page displays the title and description you specify and stores the template under the group you select, for example,My Templates
. - In the File location box, specify a file name and location for the template SLTX file.
Tip
Save the template on the MATLABĀ® path to make it visible on the Simulink Start Page. If you save the template to a location that is not on the path, the new template is visible on the Start Page only in the current MATLAB session. Saving the template does not add the destination folder to the path. - Optionally, specify a thumbnail image for the template, clickChange, then select an image file.
- Click Export.
In R2025a: You can pin a group of templates to appear first in the available template groups. If you pin more than one group, Simulink orders them by the most recently pinned. Simulink orders all the other template groups alphabetically.
Edit a Template
To edit a model file template, open the template from the Files panel or from the Simulink Start Page. Make the desired changes.
- Open the template for editing.
- From the Files panel, navigate to the template (
*.sltx
). Right-click the template and select . - From the Simulink Start Page, point to the template and click the arrow to see the template information. On the Create button, click the arrow and select .
- From the Files panel, navigate to the template (
- Make the changes you want.
- You can also edit the template properties.
- For a model template, on the Simulation tab, clickTemplate Properties.
- For a subsystem template, on the Subsystem tab, clickTemplate Properties.
- For a library template, on the Library tab, clickTemplate Properties.
- Save the template for your changes to take effect.