| Signal Processing Blockset™ | ![]() |
Signal Processing Sources
dspsrcs4
Math Functions / Matrices and Linear Algebra / Matrix Operations
dspmtrx3

The Identity Matrix block generates a rectangular matrix with ones on the main diagonal and zeros elsewhere.
When you select the Inherit output port attributes from input port check box, the input port is enabled, and an M-by-N matrix input generates a sample-based M-by-N matrix output with the same sample period. The values in the input matrix are ignored.
y = eye([M N]) % Equivalent MATLAB code
When you do not select the Inherit output port attributes from input port check box, the input port is disabled, and the dimensions of the output matrix are determined by the Matrix size parameter. A scalar value, M, specifies an M-by-M identity matrix, while a two-element vector, [M N], specifies an M-by-N unit-diagonal matrix. The output is sample based, and has the sample period specified by the Sample time parameter.
Set Matrix size to [3 6] to generate the 3-by-6 unit-diagonal matrix below.

The Main pane of the Identity Matrix block dialog appears as follows.

Enables the input port when selected. In this mode, the output inherits its dimensions, sample period, and data type from the input. The output is always real.
The number of rows and columns in the output matrix: a scalar M for a square M-by-M output, or a vector [M N] for an M-by-N output. This parameter is disabled when you select Inherit input port attributes from input port.
The discrete sample period of the output. This parameter is disabled when you select Inherit input port attributes from input port.
The Data Types pane of the Identity Matrix block dialog appears as follows.

Specify the output data type in one of the following ways:
Choose one of the built-in data types from the list.
Choose Fixed-point to specify the output data type and scaling in the Signed, Word length, Set fraction length in output to, and Fraction length parameters.
Choose User-defined to specify the output data type and scaling in the User-defined data type, Set fraction length in output to, and Fraction length parameters.
Choose Inherit via back propagation to set the output data type and scaling to match the following block
Select to output a signed fixed-point signal. Otherwise, the signal is unsigned. This parameter is visible only when you select Fixed-point for the Output data type parameter.
Specify the word length, in bits, of the fixed-point output data type. This parameter is visible only when you select Fixed-point for the Output data type parameter.
Specify any built-in or fixed-point data type. You can specify fixed-point data types using the following Simulink® Fixed Point™ functions: sfix, ufix, sint, uint, sfrac, and ufrac. This parameter is visible only when you select User-defined for the Output data type parameter.
Specify the scaling of the fixed-point output by either of the following two methods:
Choose Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
Choose User-defined to specify the output scaling in the Fraction length parameter.
This parameter is visible only when you select Fixed-point for the Output data type parameter, or when you select User-defined and the specified output data type is a fixed-point data type.
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is visible only when you select Fixed-point or User-defined for the Output data type parameter and User-defined for the Set fraction length in output to parameter.
| Port | Supported Data Types |
|---|---|
Input |
|
Output |
|
| Constant Diagonal Matrix | Signal Processing Blockset |
| Constant | Simulink |
| eye | MATLAB |
![]() | IDCT | IDWT | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |