Main Content

Create Template from 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. SeeUsing Templates to Create Standard Project Settings.

  1. In the model, on theSimulationtab, selectSave>Template.

  2. In the Exportmodelnameto 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 theFile locationbox, 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.

  4. Optionally, specify a thumbnail image for the template, clickChange, then select an image file.

  5. ClickExport.

Edit a Template

To edit a model file template, open the template from theCurrent Folderor from the Simulink Start Page. Make the desired changes.

  1. Open the template for editing.

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

    • From the Simulink Start Page, point to the template and click the arrow to see the template information. On theCreatebutton, click the arrow and selectEdit Template.

  2. Make the changes you want.

  3. You can also edit the template properties.

    • For a model template, on theSimulationtab, clickTemplate Properties.

    • For a subsystem template, on theSubsystemtab, clickTemplate Properties.

    • For a library template, on theLibrarytab, clickTemplate Properties.

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

See Also

Related Topics