# sdo.requirements.FunctionMatching Class

**Namespace: **sdo.requirements

**Superclasses: **

Impose function matching constraint on variable

## Description

Use the `sdo.requirements.FunctionMatching`

object
to impose a function matching constraint on the values of a variable
in a Simulink^{®} model. The variable can be a vector, matrix, or
a multidimensional array that is a parameter in your model, such as
the data of a lookup table in your model. You create the requirement
object, and specify the linear or quadratic function that you want
the variable to match. For example, for a two-dimensional variable,
you can specify that test data from dependent variable `V`

match
a linear function of independent variables `X`

and _{1}`X`

:_{2}

$$V={a}_{0}+{a}_{1}{X}_{1}+{a}_{2}{X}_{2}$$

Where, `a`

, _{0}`a`

,
and _{1}`a`

are the fit-coefficients,
and _{2}`X`

and _{1}`X`

are
vectors._{2}

You use the `evalRequirement`

method to evaluate
whether your test data satisfies the specified requirement, and specify
the independent variable vectors as inputs to the method. The software
calculates the fit-coefficients using the independent variables and
test data and then calculates the error between the test data and
the specified function of the independent variables.

You can use the requirement object as an input to your cost function and
use the `evalRequirement`

command in the cost function
to evaluate the requirement. You can then use the cost function and `sdo.optimize`

to perform response optimization,
subject to satisfaction of the specified requirement. If you are performing
sensitivity analysis, after you generate parameter samples, you can
use the cost function and `sdo.evaluate`

to
evaluate the requirement for each generated sample.

## Construction

creates an
`match_req`

=
sdo.requirements.FunctionMatching`sdo.requirements.FunctionMatching`

requirement object and assigns
default values to its properties. Use dot notation to customize the properties. Use the
`evalRequirement`

command to evaluate whether test data satisfies
the specified requirement.

specifies one or more properties using name-value
arguments. For example, `match_req`

=
sdo.requirements.FunctionMatching(Name=Value)```
match_req =
sdo.requirements.FunctionMatching(Type="quadratic")
```

creates an
`sdo.requirements.FunctionMatching`

object and specifies the function
to be matched as quadratic.

Before R2021a, use commas to separate each name and value, and enclose
`Name`

in quotes. For example, ```
match_req =
sdo.requirements.FunctionMatching("Type","quadratic")
```

creates an
`sdo.requirements.FunctionMatching`

object and specifies the function
to be matched as quadratic.

## Properties

## Methods

`copy` | Copy design requirement |

`get` | Get design requirement property values |

`set` | Set design requirement property values |

`evalRequirement` | Evaluate design requirement |

## Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects.

## Examples

## Version History

**Introduced in R2016b**