User`s guide
Create Diagonal Matrix
5-115
5Create Diagonal Matrix
Purpose Create a square diagonal matrix from diagonal elements.
Library Math Functions / Matrices and Linear Algebra / Matrix Operations
Description The Create Diagonal Matrix block populates the diagonal of the M-by-M matrix 
output with the elements contained in the length-M vector input,
D. The 
elements off the diagonal are zero. 
A = diag(D) Equivalent MATLAB code
The output is always sample-based.
Dialog Box
Supported 
Data Types
See Also
Double-precision floating point 
Constant Diagonal Matrix DSP Blockset
Extract Diagonal DSP Blockset
diag
MATLAB










