# minreal

Minimal realization.

## Syntax

[AM, BM, CM, DM] = minreal(A, B, C, D)

[AM, BM, CM, DM] = minreal(A, B, C, D, TOL)

SYSM = minreal(SYSIN, TOL)

SYSM = minreal(SYSIN)

## Inputs

A
The state matrix (n x n), where n is the number of states.
B
The input matrix (n x p), where p is the number of inputs.
C
The output matrix (q x n), where q is the number of outputs.
D
The direct transmission matrix (q x p).
TOL
The tolerance used for state elimination. Default = sqrt(eps()).
SYSIN
A state-space model.

## Outputs

AM
The state matrix (n x n), where n is the number of states.
BM
The input matrix (n x p), where p is the number of inputs.
CM
The output matrix (q x n), where q is the number of outputs.
DM
The direct transmission matrix (q x p).
SYSM
The minimum realization state-space model.

## Example

State space model input:
a = [-3.0000   -3.4000;
0     -3.4000]

b = [1.2000;1.2000]

c = [0.4    -0.4]

d = [1]

sys = ss(a, b, c, d)
sysm = minreal(sys)
sys = object [
Scaled: 0
TimeUnit: seconds
ts: 0
a: [Matrix] 2 x 2
-3.00000  -3.40000
0.00000  -3.40000
b: [Matrix] 2 x 1
1.20000
1.20000
c: [Matrix] 1 x 2
0.40000  -0.40000
d: 1
e: [Matrix] 0 x 0
type: StateSpaceModel
]
sysm = object [
Scaled: 0
TimeUnit: seconds
ts: 0
a: [Matrix] 2 x 2
-4.90000  -1.90000
1.50000  -1.50000
b: [Matrix] 2 x 1
-1.69706
0.00000
c: [Matrix] 1 x 2
5.55112e-17  5.65685e-01
d: 1
e: [Matrix] 0 x 0
type: StateSpaceModel
]