DSP Blockset Previous page   Next Page
Identity Matrix

Generate a matrix with ones on the main diagonal and zeros elsewhere

Library

DSP Sources

Math Functions / Matrices and Linear Algebra / Matrix Operations

Description

The Identity Matrix block generates a rectangular matrix with ones on the main diagonal and zeros elsewhere.

When the Inherit output port attributes from input port check box is selected, 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.

When the Inherit output port attributes from input port check box is not selected, 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.

Examples

Set Matrix size to [3 6] to generate the 3-by-6 unit-diagonal matrix below.

Dialog Box

Inherit output port attributes from input port
Enables the input port when selected. The output inherits its dimensions and sample period from the input.
Matrix size
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 Inherit input port attributes from input port is selected.
Sample time
The discrete sample period of the output. This parameter is disabled when Inherit input port attributes from input port is selected.
Show additional parameters
If selected, additional parameters specific to implementation of the block become visible as shown.

Allow overrides from DSP Fixed-Point Attributes blocks
If you select this parameter, and if the Output data type parameter is set to Fixed-point, fixed-point data types for this block may be set by DSP Fixed-Point Attributes blocks in your model. If this parameter is unselected, the data types are always set by the parameters in the block mask.
Output data type
Specify the output data type in one of the following ways:
Word length
Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible if Fixed-point is selected for the Output data type parameter.
User-defined data type
Specify any built-in or fixed-point data type. You can specify fixed-point data types using the sfix, ufix, sint, uint, sfrac, and ufrac functions from the Fixed-Point Blockset. This parameter is only visible if User-defined is selected for the Output data type parameter.
Set fraction length in output to
Specify the scaling of the fixed-point output by either of the following two methods:
Fraction length
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is only visible if Fixed-point or User-defined is selected for the Output data type parameter, and if User-defined is selected for the Set fraction length in output to parameter.

Supported Data Types

To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

Constant Diagonal Matrix
DSP Blockset
DSP Constant
DSP Blockset
eye
MATLAB

Also Creating Signals Using Constant Blocks for how to use this and other blocks to generate constant signals.


Previous page  IDCT IDWT Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS