User`s guide
Extract Diagonal
5-170
5Extract Diagonal
Purpose Extract the main diagonal of the input matrix.
Library Math Functions / Matrices and Linear Algebra / Matrix Operations
Description The Extract Diagonal block populates the 1-D output vector with the elements 
on the main diagonal of the M-by-N input matrix
A. 
D = diag(A) Equivalent MATLAB code
The output vector has length min(M,N), and is always sample-based.
Dialog Box
Supported 
Data Types
See Also
Fixed-point
Custom data types
Boolean
8-, 16-, and 32-bit signed integer 
8-, 16-, and 32-bit unsigned integer
Single-precision floating point 
Double-precision floating point 
Constant Diagonal Matrix DSP Blockset
Create Diagonal Matrix DSP Blockset
Extract Triangular Matrix DSP Blockset
diag
MATLAB










