| Signal Processing Blockset™ | ![]() |
Signal Processing Sources
dspsrcs4
Math Functions / Matrices and Linear Algebra / Matrix Operations
dspmtrx3
The Constant Diagonal Matrix block outputs a square diagonal matrix constant. The Constant along diagonal parameter determines the values along the matrix diagonal. This parameter can be a scalar to be repeated for all elements along the diagonal, or a vector containing the values of the diagonal elements. To generate the identity matrix, set the Constant along diagonal to 1, or use the Identity Matrix block.
The output is frame based when you select the Frame-based output check box; otherwise, the output is sample based.
The Main pane of the Constant Diagonal Matrix block dialog appears as follows.

Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters During Simulation in the online Simulink® documentation for details.
Specify the values of the elements along the diagonal. You can input a scalar or a vector. Tunable.
When you specify any data type information in this field, it is overridden by the value of the Output data type parameter on the Data Types pane, unless you select Inherit from 'Constant(s) along diagonal'.
Select to cause the output of the block to be frame based. Otherwise, the output is sample based.
The Data types pane of the Constant Diagonal Matrix block dialog appears as follows.

Specify the output data type in one of the following ways:
Choose one of the built-in data types from the list.
Choose Fixed-point to specify the output data type and scaling in the Signed, Word length, Set fraction length in output to, and Fraction length parameters.
Choose User-defined to specify the output data type and scaling in the User-defined data type, Set fraction length in output to, and Fraction length parameters.
Choose Inherit from 'Constant(s) along diagonal' to set the output data type and scaling to match the values of the Constant(s) along diagonal parameter on the Main pane.
Choose Inherit via back propagation to set the output data type and scaling to match the next block downstream.
The value of this parameter overrides any data type information specified in the Constant(s) along diagonal parameter on the Main pane, except when you select Inherit from 'Constant(s) along diagonal'.
Select to output a signed fixed-point signal. Otherwise, the signal is unsigned. This parameter is only visible when you select Fixed-point for the Output data type parameter.
Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible when you select Fixed-point for the Output data type parameter.
Specify any built-in or fixed-point data type. You can specify fixed-point data types using the following Simulink® Fixed Point™ functions: sfix, ufix, sint, uint, sfrac, and ufrac. This parameter is only visible when you select User-defined for the Output data type parameter.
Specify the scaling of the fixed-point output by either of the following two methods:
Choose Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
Choose User-defined to specify the output scaling in the Fraction length parameter.
This parameter is only visible when you select Fixed-point for the Output data type parameter, or when you select User-defined and the specified output data type is a fixed-point data type.
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is only visible when you select Fixed-point or User-defined for the Output data type parameter and User-defined for the Set fraction length in output to parameter.
Double-precision floating point
Single-precision floating point
Fixed point
8-, 16-, and 32-bit signed integers
8-, 16-, and 32-bit unsigned integers
| Create Diagonal Matrix | Signal Processing Blockset |
| Constant | Simulink |
| Identity Matrix | Signal Processing Blockset |
| diag | MATLAB |
![]() | Complex Exponential | Constant Ramp | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |