Documentation

Simulink.createFromTemplate

Create model or project from template

Syntax

Simulink.createFromTemplate(templatename)
h = Simulink.createFromTemplate(templatename)
h = Simulink.createFromTemplate(templatename,Name,Value)

Description

example

Simulink.createFromTemplate(templatename) creates a model or a project from the template file specified by templatename.

example

h = Simulink.createFromTemplate(templatename) creates a model or a project from the template file and returns h, either a numeric model handle or a simulinkproject object.

example

h = Simulink.createFromTemplate(templatename,Name,Value) specifies additional options as one or more Name, Value pair arguments.

Examples

collapse all

Simulink.createFromTemplate('simple_simulation.sltx')

Create a project from a template, specify the name and root folder, and return the handle to the new project (a simulinkproject object) for manipulating it programmatically.

proj = Simulink.createFromTemplate('code_generation_example.sltx','Name','myProject','Folder','C:\Work\project1')

Input Arguments

collapse all

Template file name, specified as a character vector. If the template is not on the MATLAB® path, specify the fully-qualified path to the template file and *.sltx extension.

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:

collapse all

Project root folder, if creating a new project, specified as a character vector.

Data Types: char

New model or project name, specified as a character vector.

Data Types: char

Output Arguments

collapse all

Handle to the new model project, returned either as a numeric model handle or a simulinkproject object.

Introduced in R2016a

Was this topic helpful?