Main Content

# blkdiag

Block-diagonal concatenation of models

## Syntax

```sys = blkdiag(sys1,sys2,...,sysN) ```

## Description

`sys = blkdiag(sys1,sys2,...,sysN)` produces the aggregate system

`$\left[\begin{array}{cccc}sys1& 0& ..& 0\\ 0& sys2& .& :\\ :& .& .& 0\\ 0& ..& 0& sysN\end{array}\right]$`

`blkdiag` is equivalent to `append`.

## Examples

collapse all

Perform block-diagonal concatenation of a transfer function model and a state-space model.

Create the SISO continuous-time transfer function model, `1/s`.

`sys1 = tf(1,[1 0]);`

Create a SISO continuous-time state-space model with state-space matrices 1,2,3, and 4.

`sys2 = ss(1,2,3,4);`

Concatenate `sys1`, a SISO static gain system, and `sys2`. The resulting model is a 3-input, 3-output state-space model.

`sys = blkdiag(sys1,10,sys2)`
```sys = A = x1 x2 x1 0 0 x2 0 1 B = u1 u2 u3 x1 1 0 0 x2 0 0 2 C = x1 x2 y1 1 0 y2 0 0 y3 0 3 D = u1 u2 u3 y1 0 0 0 y2 0 10 0 y3 0 0 4 Continuous-time state-space model. ```

Alternatively, use the `append `command.

`sys = append(sys1,10,sys2);`

## Version History

Introduced in R2009a