Main Content

add_param

Add parameter to金宝appsystem

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 theset_paramandget_paramfunctions on the parameters.

Examples

collapse all

Add the parametersDemoNameandEquationOrderto thevdpmodel with the values'VanDerPolEquation'and'2', respectively.

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

Use theget_paramfunction 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'相当于'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 correspondingval1argument.

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 correspondingparam1argument.

Data Types:char|string

Introduced before R2006a