Extract main diagonal of input matrix
The Extract Diagonal block populates the unoriented 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).
Double-precision floating point
Single-precision floating point
Fixed point (signed and unsigned)
Boolean — Block outputs are always Boolean.
8-, 16-, and 32-bit signed integers
8-, 16-, and 32-bit unsigned integers