diag

Block Category: Matrix Operation

Input: Vector

Description: The diag block creates a square matrix with the input vector on the diagonal and zeros elsewhere. You can specify an offset from the main diagonal. 

Diagonal Offset: Indicates the offset from the main diagonal. The default is 0, which puts vector V on the main diagonal.

Label: Indicates a user-defined block label that appears when View > Block Labels is activated.

 

Example

The diag block produces a 10-by-10 matrix. The 9-element vector is placed on the diagonal with an offset of 1. The remaining cells are padded with zeros.