Simulink.exportToTemplate

Create template from model or project

Description

example

templatefile = Simulink.exportToTemplate(obj,templatename) creates a template file (templatename.sltx) from a model or project specified by obj.

If you have project templates created in R2014a or earlier (.zip files), use Simulink.exportToTemplate to upgrade them to .sltx files, then you can use them in the start page.

example

templatefile = Simulink.exportToTemplate(obj,templatename,Name,Value) specifies additional template options as one or more Name, Value pair arguments.

Examples

collapse all

Open the vdp model and create a template from it.

vdp
myvdptemplate = Simulink.exportToTemplate(bdroot,'vdptemplate')

Open the vdp model and create a template from it, specifying a description.

vdp
myvdptemplate = Simulink.exportToTemplate(bdroot,'vdptemplate','Description','Use this template to create a vdp model')

Input Arguments

collapse all

Model, library, or project, specified by name or numeric handle, or a slproject.ProjectManager object returned by the currentProject function.

Data Types: double | char

Template file name, specified as a character vector that can optionally include the fully-qualified path to a template file and *.sltx extension.

Data Types: char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: Title,'My Project Template'

Group of template, specified as a character vector. On the Start Page, templates are shown under group headings.

Example: 'My Templates'

Data Types: char

Author of template, specified as a character vector.

Data Types: char

Description of template, specified as a character vector.

Data Types: char

Thumbnail image file name, specified as a character vector.

Data Types: char

Title of template, specified as a character vector. On the Start Page, the templates titles are shown on the tiles. The title can be different from the file name, and you can use any characters in the title. The default value is the name of the model or project.

Example: 'My Project Template'

Data Types: char

Output Arguments

collapse all

Template file, returned as templatename.sltx file.

Introduced in R2016a