# abcd

Construct state-space matrices from `rational` object

Since R2020a

## Syntax

``[A,B,C,D,sharedpoles] = abcd(fit)``

## Description

example

````[A,B,C,D,sharedpoles] = abcd(fit)` constructs real diagonal form `A`, `B`, `C`, and `D` state-space matrices from input `fit`, a `rational` object. This function also indicates whether or not each element of `fit` has the same poles using `sharedpoles` output argument.```

## Examples

collapse all

Create S-Parameters from the file named `passive.s2p`.

`S = sparameters('passive.s2p');`

Perform rational fitting of the S-parameters.

`fit = rational(S);`

Construct state-space matrices from rational object, `fit`.

`[A,B,C,D,sharedpoles] = abcd(fit)`
```A = 1.0e+11 * (1,1) -0.0008 (2,1) -0.0011 (1,2) 0.0011 (2,2) -0.0008 (3,3) -4.0560 (4,4) -0.8359 (5,5) -0.5389 (6,6) -0.1148 (7,7) -0.0173 (8,8) -0.0008 (9,9) -0.0008 (10,9) -0.0011 (9,10) 0.0011 (10,10) -0.0008 (11,11) -4.0560 (12,12) -0.8359 (13,13) -0.5389 (14,14) -0.1148 (15,15) -0.0173 (16,16) -0.0008 ```
```B = (1,1) 1.4142 (3,1) 1.0000 (4,1) 1.0000 (5,1) 1.0000 (6,1) 1.0000 (7,1) 1.0000 (8,1) 1.0000 (9,2) 1.4142 (11,2) 1.0000 (12,2) 1.0000 (13,2) 1.0000 (14,2) 1.0000 (15,2) 1.0000 (16,2) 1.0000 ```
```C = 2×16 1011 × 0.0001 0.0001 -2.8008 0.6205 0.0907 0.0831 -0.0015 -0.0006 -0.0001 -0.0001 -3.1065 2.4562 -0.7797 -0.0750 0.0010 0.0007 -0.0001 -0.0001 -3.1236 2.4641 -0.7827 -0.0750 0.0010 0.0007 0.0001 0.0001 -2.6254 0.4517 0.1564 0.0878 -0.0015 -0.0006 ```
```D = 2×2 0 0 0 0 ```
```sharedpoles = logical 1 ```

## Input Arguments

collapse all

Rational fit, specified as a `rational` or `rfmodel.rational` object.

## Output Arguments

collapse all

State-space matrices, returned as an array of scalar numbers. The size of the state-space matrix elements are

• `A`M-by-M array.

• `B`M-by-`NumPorts` array.

• `C``NumPorts`-by-M array.

• `D``NumPorts`-by-`NumPorts` array.

where, M is `NumPoles` × `NumPorts` and `NumPoles` and `NumPorts` are number of poles and ports, respectively, derived from `fit`.

Shared poles indicating whether or not each element of `fit` has the same poles, returned as `1` or `0` of data type `logical`.

Data Types: `logical`

## Version History

Introduced in R2020a