# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

Generate random discrete test model

## Syntax

```sys = drss(n) drss(n,p) drss(n,p,m) drss(n,p,m,s1,...sn) ```

## Description

`sys = drss(n) ` generates an n-th order model with one input and one output, and returns the model in the state-space object `sys`. The poles of `sys` are random and stable with the possible exception of poles at ```z = 1``` (integrators).

`drss(n,p) ` generates an n-th order model with one input and `p` outputs.

`drss(n,p,m) ` generates an n-th order model with `p` outputs and `m` inputs.

`drss(n,p,m,s1,...sn) ` generates a s1-by-sn array of n-th order models with `m` inputs and `p` outputs.

In all cases, the discrete-time state-space model or array returned by `drss` has an unspecified sample time. To generate transfer function or zero-pole-gain systems, convert `sys` using `tf` or `zpk`.

## Examples

Generate a discrete LTI system with three states, four outputs, and two inputs.

```sys = drss(3,4,2) a = x1 x2 x3 x1 0.4766 0.1102 -0.7222 x2 0.1102 0.9115 0.1628 x3 -0.7222 0.1628 -0.202 b = u1 u2 x1 -0.4326 0.2877 x2 -0 -0 x3 0 1.191 c = x1 x2 x3 y1 1.189 -0.1867 -0 y2 -0.03763 0.7258 0.1139 y3 0.3273 -0.5883 1.067 y4 0.1746 2.183 0 d = u1 u2 y1 -0.09565 0 y2 -0.8323 1.624 y3 0.2944 -0.6918 y4 -0 0.858 Sample time: unspecified Discrete-time model.```