%% Simulate and Generate Code for Speed Cruise Control System
% This example shows how to simulate and generate code for the Controller
% subsystem from a speed cruise control model by using Simulink(R) and
% Stateflow(R).
%
%   Copyright 2007-2013 The MathWorks, Inc.
%% Open the Model
open_system('plcdemo_cruise_control')
%%
% To start the simulation, click *Run*.
%
%% Generate Code
%
% To generate code for the Controller subsystem, use <docid:plccoder_ref.bsei6je_1
% plcgeneratecode>:
%
%   generatedfiles = plcgeneratecode('plcdemo_cruise_control/Controller');
%
% The Controller subsystem performs the Enable and Setpoint calculations by
% using a Triggered Stateflow(R) chart. The Throttle Command is computed
% by using a discrete PID controller.




