parameters
Declare domain or component parameters
Parent Section: component | domain
Syntax
parameters par1 = {value,'unit'}; end
Description
parameters
begins a parameters declaration section, which is
terminated by an end
keyword:
In a component file, this section contains declarations for the component parameters. Component parameters let you specify adjustable parameters for the Simscape™ block generated from the component file. Parameters appear in the block dialog box and can be modified when building and simulating a model.
In a domain file, this section contains declarations for the domain parameters. The main purpose of domain parameters is to propagate the same parameter value to all or some of the components connected to the domain.
You declare each parameter as a value with unit:
parameters par1 = {value,'unit'}; end
value
is the initial parameter value. unit
is a
valid unit string, defined in the unit registry.
To declare a unitless parameter, you can either use the same syntax:
par1 = {value,'1'};
or omit the unit and use this syntax:
par1 = value;
Internally, however, this parameter is treated as a two-member value-unit array
{value,'1'}
.
For component parameters, adding a comment after the parameter declaration lets you specify the parameter name, the way you want it to appear in the block dialog box:
parameters comp_par1 = {value,'unit'}; % Parameter name end
Examples
Version History
Introduced in R2008b