DiagonalMatrix

This block creates a diagonal matrix from a 1D vector. If the length of the input vector is M then the output is an M-by-M matrix.

    DiagonalMatrix

Library

MatrixOperations

Description

This block creates a diagonal matrix from a 1D vector. If the length of the input vector is M then the output is an M-by-M matrix.

If the offset value is non-zero, the vector will be placed off-diagonal and the matrix size will be (M+|offset|)x(M+|offset|).

Parameters

DiagonalMatrix_0

NameLabelDescriptionData TypeValid Values

offset

Diagonal offset

This used to create off-diagonal square matrix with the input vector.

Scalar

externalActivation

External activation

Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected.

Number

0
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

1

Port 2

explicit

This parameter allows diagonal.

input

1

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no