Documentation

Simulink.findTemplates

Find model or project templates with specified properties

Syntax

filename = Simulink.findTemplates(templatename)
filename = Simulink.findTemplates(templatename,Name,Value)
[filename,info] = Simulink.findTemplates(templatename)

Description

example

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.

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 “*”.

Example:

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 single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Author','*son'

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

collapse all

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.

Introduced in R2016a

Was this topic helpful?