Main Content

add_param

Add parameter to Simulink system

Description

example

add_param(sys,param1,val1,...,paramN,valN) adds the specified parameters to the specified system and initializes the parameters to the specified values. The parameters are saved in the corresponding SLX or MDL file. You can use the set_param and get_param functions on the parameters.

Examples

collapse all

Add the parameters DemoName and EquationOrder to the vdp model with the values 'VanDerPolEquation' and '2', respectively.

add_param('vdp','DemoName','VanDerPolEquation','EquationOrder','2')

Use the get_param function to query the values of the new parameters.

get_param('vdp','DemoName')
ans =

    'VanDerPolEquation'

Input Arguments

collapse all

System name or handle, specified as a character vector, string scalar, or numeric scalar. The system must be an SLX or MDL file.

Data Types: double | char | string

Name of parameter, specified as a character vector or string scalar.

Parameter names are case insensitive. For example, 'ParameterName' is equivalent to 'parametername'.

You cannot add a parameter that has the same name as an existing parameter of the system.

Dependencies

To use this parameter, specify a corresponding val1 argument.

Data Types: char | string

Initial value of parameter, specified as a character vector or string scalar.

Values are case sensitive.

Dependencies

To use this parameter, specify a corresponding param1 argument.

Data Types: char | string

Introduced before R2006a