Main Content

Create a Template from a Model

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 Using Templates to Create Standard Project Settings.

  1. In the model, on the Simulation tab, select Save > Template.

  2. 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.

  3. In the Template file box, select 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 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.

  4. (Optional) To specify a thumbnail image for the template, click Change, then select an image file.

  5. Click Export.

Edit a Template

To edit a model file template, open the template from the Current Folder or from the Simulink start page. Make the desired changes.

  1. Open the template for editing.

    • From the Current Folder, navigate to the template (*.sltx). Right-click the template and select Open Template for Editing.

    • 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 Edit Template.

  2. Make the changes you want.

  3. You can also edit the template properties.

    • For a model template, on the Simulation tab, click Template Properties.

    • For a subsystem template, on the Subsystem tab, click Template Properties.

    • For a library template, on the Library tab, click Template Properties.

  4. Save the template for your changes to take effect.

See Also

Related Topics