Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

# setData

Set values of tunable-surface coefficients

## Syntax

``Knew = setData(K,Kco)``
``Knew = getData(K,J,KcoJ)``

## Description

````Knew = setData(K,Kco)` sets the current values of the tunable coefficients of a tunable surface. `K` is a `tunableSurface` object that represents the parametric gain surface:$K\left(n\left(\sigma \right)\right)=\gamma \left[{K}_{0}+{K}_{1}{F}_{1}\left(n\left(\sigma \right)\right)+\dots +{K}_{M}{F}_{M}\left(n\left(\sigma \right)\right)\right],$where: σ is a vector of scheduling variables.n(σ) is a normalization function and γ is a scaling factor (see the `Normalization` property of `tunableSurface`). F1,...,FM are basis functions.K0,...,KM are tunable coefficients.`Kco` is an array of new values for the coefficients [K0,...,KM].```
````Knew = getData(K,J,KcoJ)` sets the current value of the coefficient of the Jth basis function FJ to `KcoJ`. Use `J` = 0 to set the constant coefficient K0.```

## Input Arguments

collapse all

Gain surface, specified as a `tunableSurface` object,

New coefficient values of the tunable surface, specified as an array.

If the tunable surface `K` is a scalar-valued gain, then the length of `K` is `(M+1)`, where `M` is the number of basis functions in the parameterization. For example, if `K` represents the tunable gain surface:

`$K\left(\alpha ,V\right)={K}_{0}+{K}_{1}\alpha +{K}_{2}V+{K}_{3}\alpha V,$`

then `Kco` is the 1-by-4 vector [K0,K1,K2,K3].

For array-valued gains, each coefficient expands to the I/O dimensions of the gain. These expanded coefficients are concatenated horizontally in `Kco`. (See `tunableSurface`.) For example, for a two-input, two-output gain surface, `Kco` has dimensions `[2,2(M+1)]`. See `evalSurf` for an example that uses `setData` on an array-valued gain.

Index of basis function, specified as a nonnegative integer. To set the constant coefficient K0, use `J` = 0.

Coefficient of the Jth basis function in the tunable surface parameterization, specified as a scalar or an array.

If the tunable surface `K` is a scalar-valued gain, then `KcoJ` is a scalar. If `K` is an array-valued gain, then `KcoJ` is an array that matches the I/O dimensions of the gain.

## Output Arguments

collapse all

Gain surface with new coefficient values, returned as a `tunableSurface` object.

## See Also

#### Learn how to automatically tune PID controller gains

Download code examples