Main Content

Simulink.findTemplates

Find model or project templates with specified properties

Description

filename = Simulink.findTemplates(templatename) returns the names and TemplateInfo objects for all matching templates that include templatename.

example

filename = Simulink.findTemplates(templatename,Name,Value) also specifies additional template properties as one or more Name, Value pair arguments.

example

[filename,info] = Simulink.findTemplates(templatename) returns the names and TemplateInfo objects for all matching templates.

example

Examples

collapse all

Get the full path to the default model template.

filename = Simulink.findTemplates('factory_default_model');

Get all templates inside folders called work.

filename = Simulink.findTemplates('work/')

Get all templates for which the Author property includes the character vector Smith.

filename = Simulink.findTemplates('*','Author','Smith')

Get the paths to all DSP model templates, and sltemplate.TemplateInfo objects for each of them.

[filename,info] = Simulink.findTemplates('dsp*','Type','Model');

Input Arguments

collapse all

Template name, specified as a character vector containing a portion of a file name, which can contain the wildcard asterisk character “*”.

Data Types: char

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Author','*son'

You can specify regular expressions for any of the Value character vectors, e.g., including the wildcard asterisk character “*”.

Model, library, or project template type, specified as a character vector for model, library, or project.

Example: 'Simscape'

Data Types: char

Title of template, specified as a character vector.

Example: 'Simscape'

Data Types: char

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

Example: 'Simscape'

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

Output Arguments

collapse all

Template names of matching templates, returned as character vectors.

Template information of matching templates, returned as sltemplate.TemplateInfo objects.

Version History

Introduced in R2016a