Width

Output width of input vector

  • Library:
  • Simulink / Signal Attributes

Description

The Width block generates as output the width of its input vector.

You can use an array of buses as an input signal to a Width block. For details about defining and using an array of buses, see Combine Buses into an Array of Buses.

Ports

Input

expand all

Input signal specified as a scalar, vector, matrix, or N-D array.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Output

expand all

Output is the width of the input signal, specified as a scalar.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Parameters

expand all

Specify the output data type to be the same as the input, or inherit the data type by back propagation. You can also choose to specify a built-in data type from the drop-down list in the Output data type parameter.

Programmatic Use

Block Parameter: OutputDataTypeScalingMode
Type: character vector
Values: 'Choose intrinsic data type' | 'Inherit via back propagation' | 'All ports same datatype'
Default: 'Choose intrinsic data type'

This parameter is visible when you select Choose intrinsic data type for Output data type mode. Select a built-in data type from the drop-down list.

Programmatic Use

Block Parameter: DataType
Type: character vector
Values: 'double' | 'single' | 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32'
Default: 'double'

Block Characteristics

Data Types

Boolean | bus | double | enumerated | fixed point | integer | single | string

Direct Feedthrough

yes

Multidimensional Signals

yes

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

Introduced before R2006a