Generate matrix with ones on main diagonal and zeros elsewhere
DSP System Toolbox / Math Functions / Matrices and Linear Algebra / Matrix Operations
DSP System Toolbox / Sources
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 an M-by-N matrix output with the same sample period as the input. The values in the input matrix are ignored. The equivalent MATLAB® code is:
y = eye([M N])
When you clear the Inherit output port attributes from input port check box, the input port is disabled, and the block determines the dimensions of the output matrix based on 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. You can specify the output sample period using the Sample time parameter.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|