Extract Diagonal
R2026bExtract main diagonal of input matrix
Libraries:
Simulink /
Matrix Operations
Description
The Extract Diagonal block populates the unoriented output vector with
the elements on the main diagonal of the M-by-N
input matrix A.
Equivalent MATLAB® code is given by:
D = diag(A)
Examples
Ports
Input
Output
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"simulink/Matrix Operations/Extract Diagonal"
Example: add_block("simulink/Matrix Operations/Extract Diagonal","myModel/myBlock",MakeNameUnique="on")
