| DSP Blockset | ![]() |
Generate a matrix with ones on the main diagonal and zeros elsewhere
Library
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
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.
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.
Fixed-point to specify the output data type and scaling in the Word length, Set fraction length in output to, and Fraction length parameters.
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.
Inherit via back propagation to set the output data type and scaling to match the following block
Fixed-point is selected for the Output data type parameter.
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.
Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
User-defined to specify the output scaling in the Fraction length parameter.
Fixed-point or User-defined is selected for the Output data type parameter, and if the specified output data type is a fixed-point data type.
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.
| IDCT | IDWT | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |