%% Specify Options for Creating MPC Code Generation Structures
% Create a plant model, and define the MPC signal types.

plant = rss(3,2,2);
plant.D = 0;

%
% Create an MPC controller.

mpcObj = mpc(plant,0.1);

%
% Create code generation data structures. Configure options to:
% Use single-precision floating-point values in the generated code.
% Improve computational efficiency by not computing optimal sequence data.
% Run your MPC controller in adaptive mode.

[configData,stateData,onlineData] = getCodeGenerationData(mpcObj,...
    'DataType','single','OnlyComputeCost',true,'IsAdaptive',true);

% Copyright 2012 The MathWorks, Inc.