inputs
Define component inputs, that is, physical signal input ports of block
Parent Section: component
Syntax
inputs in1 = { value , 'unit' }; end
Description
inputs
begins a component inputs declaration section, which is
terminated by an end
keyword. This section contains declarations for
component inputs, which correspond to the physical signal input ports of a Simscape™ block generated from the component file.
Each input can be defined as:
A value with unit, where
value
can be a scalar, vector, or matrix. For a vector or a matrix, all signals have the same unit.An untyped identifier, to facilitate unit propagation.
The following syntax declares a component input, in1
, as a value
with unit. value
is the initial value. unit
is a
valid unit string, defined in the unit registry.
inputs in1 = { value , 'unit' }; end
If you declare an input without a value and unit, as an untyped identifier, it
propagates the signal type (size and unit) based on the component connections in the
model. Use the following syntax to declare a component input, in1
, as
an untyped identifier.
inputs in1; end
Note
During sscbuild
validation, or when an input is unconnected
in a model, untyped inputs receive the type of unitless scalar, that is,
{0, '1'}
. Therefore, a component with an untyped input must
support the type of the input being resolved to unitless scalar.
You can specify the input port label, the way you want it to appear in the block diagram, as a comment:
inputs in1 = { value , 'unit' }; % label end
where label
is a string corresponding to the input port name in the
block diagram. You can use the Side
annotation to specify the port
location on the block icon. For more information, see Customize the Names and Locations of the Block Ports.
Examples
Version History
Introduced in R2008b