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 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 get sltemplate.TemplateInfo objects for each template.

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

Input Arguments

collapse all

Template name, specified as a string scalar or a character vector. The template name contains a portion of a file name and can contain the wildcard asterisk character “*”.

Data Types: char

Name-Value Arguments

collapse all

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.

Example: Simulink.findTemplates("*",Author="Smith")

You can specify regular expressions for any of the value character vectors by including the wildcard asterisk character “*”.

Template type, specified as a string scalar or a character vector.

Example: 'Simscape'

Data Types: char | string

Title of template, specified as a string scalar or a character vector.

Example: 'Simscape'

Data Types: char | string

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

Example: 'Simscape'

Data Types: char

Author of template, specified as a string scalar or a character vector.

Data Types: char | string

Description of template, specified as a string scalar or a character vector.

Data Types: char | string

Output Arguments

collapse all

Template names of matching templates, returned as a cell array of character vectors.

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

Version History

Introduced in R2016a