Generate random continuous test model

Syntax

```rss(n) rss(n,p) rss(n,p,m,s1,...,sn) ```

Description

`rss(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 ```s = 0``` (integrators).

`rss(n,p) ` generates an `n`th order model with one input and `p` outputs, and `rss(n,p,m)` generates an `n-`th order model with `m` inputs and `p` outputs. The output `sys` is always a state-space model.

`rss(n,p,m,s1,...,sn)` generates an s1-by-...-by-sn array of n-th order state-space models with `m` inputs and `p` outputs.

Use `tf`, `frd`, or `zpk` to convert the state-space object `sys` to transfer function, frequency response, or zero-pole-gain form.

Examples

collapse all

Generate a random SISO state-space model with two states.

`sys2 = rss(2)`
```sys2 = A = x1 x2 x1 -0.8429 -0.2134 x2 -0.5162 -1.214 B = u1 x1 0.7254 x2 -0.06305 C = x1 x2 y1 0 -0.205 D = u1 y1 -0.1241 Continuous-time state-space model. ```

Generate a model with four states, three outputs, and two inputs. The input arguments to `rss` are arranged in the order states, outputs, inputs.

`sys4 = rss(4,3,2)`
```sys4 = A = x1 x2 x3 x4 x1 45.92 1.332 -9.841 -18.02 x2 -3.679 -0.8695 2.348 -0.8719 x3 89.8 -2.097 -22.31 -28.27 x4 79.49 -2.367 -19.69 -24.7 B = u1 u2 x1 0 -0.2256 x2 1.533 0 x3 -0.7697 0 x4 0 0.03256 C = x1 x2 x3 x4 y1 0.5525 0.08593 -1.062 0.7481 y2 1.101 0 2.35 -0.1924 y3 1.544 0 -0.6156 0.8886 D = u1 u2 y1 0 0.4882 y2 -1.402 0 y3 0 -0.1961 Continuous-time state-space model. ```

Generate a 4-by-5 array of SISO models with three states each.

```sysarray = rss(3,1,1,4,5); size(sysarray)```
```4x5 array of state-space models. Each model has 1 outputs, 1 inputs, and 3 states. ```

Version History

Introduced before R2006a