%% Document Generated Code
% This example shows how to use the Simulink(R) Report Generator with
% Simulink(R) Coder(TM) to automatically generate documentation for a model and
% its generated code.
%%
% Open the model |rtwdemo_codegenrpt|.
model='rtwdemo_codegenrpt';
open_system(model)
%%
% Generate code for the model.
evalc('rtwbuild(''rtwdemo_codegenrpt'')');

%%
% After generating the code, Simulink Coder displays an HTML code generation
% report that includes embedded hyperlinks to the generated source files.
%% 
% To generate a project document, use the Simulink Report Generator.
rtwreport('rtwdemo_codegenrpt');

%%
% The generated report documents the model and the generated code. The
% report includes:
%
% * Snapshots of the model, including subsystems.
% * A block execution order list.
% * A summary of the generated code.
% * Full listings of generated code files in the build folder.

%%
% Close the model.
rtwdemoclean;
close_system(model,0)

%% 
% If you have a Simulink Report Generator license, you can customize the
% generated document by using the Report Explorer.

%   Copyright 2007-2015 The MathWorks, Inc.


