diagonal

Purpose

Define a diagonal matrix variable.

 Synopsis

X=diagonal;

X=diagonal(n);

Description

The program defines an “abst” data of type “variable”, representing a diagonal matrix variable of size n-by-n, where n is the only argument (default n = 1).

 Example

To define matrix variable

$$X=\begin{bmatrix}x_{1} & 0 & 0\\0 & x_{2} & 0\\0 & 0 & x_{3}\end{bmatrix}$$

type

>> X=diagonal(3);

See also

rectangular, skew, symmetricvariable