# repsys

Replicate and tile models

## Syntax

``rsys = repsys(sys,[M N])``
``rsys = repsys(sys,N)``
``rsys = repsys(sys,[M N,S1 S2 ... SK])``

## Description

example

````rsys = repsys(sys,[M N])` replicates the model `sys` into an `M`-by-`N` tiling pattern. The resulting model `rsys` has `size(sys,1)*M` outputs and `size(sys,2)*N` inputs.```
````rsys = repsys(sys,N)` creates an `N`-by-`N` tiling. This syntax produces the same result as `rsys = repsys(sys,[N N])`. To produce a diagonal tiling, use `rsys = sys*eye(N)`.```

example

````rsys = repsys(sys,[M N,S1 S2 ... SK])` replicates and tiles `sys` along both I/O and array dimensions to produce a model array. The indices `S` specify the array dimensions. The size of the array is `[size(sys,1)*M, size(sys,2)*N, size(sys,3)*S1, ...]`.```

## Examples

collapse all

Create a single-input single-output (SISO) transfer function.

`sys = tf(2,[1 3])`
```sys = 2 ----- s + 3 Continuous-time transfer function. ```

Replicate the SISO transfer function to create a MIMO transfer function that has three inputs and two outputs.

`rsys = repsys(sys,[2 3])`
```rsys = From input 1 to output... 2 1: ----- s + 3 2 2: ----- s + 3 From input 2 to output... 2 1: ----- s + 3 2 2: ----- s + 3 From input 3 to output... 2 1: ----- s + 3 2 2: ----- s + 3 Continuous-time transfer function. ```

Alternatively, you can obtain the MIMO transfer function as follows:

`rsys = [sys sys sys; sys sys sys];`

Create a SISO transfer function.

`sys = tf(2,[1 3]);`

Replicate the transfer function into a 3-by-4 array of two-input, one-output transfer functions.

`rsys = repsys(sys,[1 2 3 4]);`

Check the size of `rsys`.

`size(rsys)`
```3x4 array of transfer functions. Each model has 1 outputs and 2 inputs. ```

## Input Arguments

collapse all

Dynamic system (SISO or MIMO), specified as one of the following dynamic system models or an array of such models.

Number of replications of `sys` along the output dimension, specified as a positive integer.

Number of replications of `sys` along the input dimension, specified as a positive integer.

Numbers of replications of `sys` along array dimensions, specified as positive integers.

## Output Arguments

collapse all

Replicated dynamic system, returned as a dynamic system model or model array.

If you specify `sys` as a single SISO or MIMO model and you do not specify array dimensions `S1,..., SK`, then `rsys` is a dynamic system model with `size(sys,1)*M` outputs and `size(sys,2)*N` inputs.

Otherwise, `rsys` is an array of dynamic systems, each with `size(sys,1)*M` outputs and `size(sys,2)*N` inputs. The size of `rsys` is ```[size(sys,1)*M, size(sys,2)*N, size(sys,3)*S1, ...]```.

## Version History

Introduced in R2010b