%% Polynomial Basis Functions of One Scheduling Variable
% Create basis functions for a gain that varies as a cubic function of one scheduling variable.

shapefcn = polyBasis('canonical',3);

%
% shapefcn is a handle to a function of one variable that returns an array of values corresponding to the first three powers of its input. In other words, shapefcn(x) = [x x^2 x^3]. For example, examine shapefcn(-0.2).

x = -0.2;
shapefcn(x)

%
% Evaluating [x x^2 x^3] for x = -0.2 returns the same result.

[x x^2 x^3]

%
% Use shapefcn as an input argument to tunableSurface to define a polynomial gain surface. This shapefcn is equivalent to using:

shapefcn = @(x) [x x^2 x^3];

% Copyright 2015 The MathWorks, Inc.