Main Content

Simulink.defaultModelTemplate

Set or get default model template

Description

example

Simulink.defaultModelTemplate(templatename) sets the template file specified by templatename as the default model template to use for new models. This setting is persistent between Simulink® sessions.

example

templatepath = Simulink.defaultModelTemplate gets the full path to the current default model template.

Examples

collapse all

Simulink.defaultModelTemplate('simple_simulation.sltx')
mydefaulttemplate = Simulink.defaultModelTemplate

Use set_param to set a root block diagram parameter. This clears the default template so that new models will inherit this property of the root block diagram, and warns.

set_param(0,'StopTime','99'); 

Restore the default template.

Simulink.defaultModelTemplate('$restore');

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: \\Home\username\Documents\MATLAB\template.sltx

Data Types: char

Output Arguments

collapse all

Template path, specified as a character vector, showing the full path to the current default model template.

Introduced in R2016b