%% Generate Reusable, Reentrant C and C++ Code From Scoped Simulink Function Blocks
% This example shows how you can generate reusable, reentrant C and C++ code by representing an algorithm as a scoped Simulink Function block. Generate code that is highly modularized by using multiple instances of a shared Simulink Function block in an export-function model. The code generator produces one instance of the function code, but associates each use or call to the function with instance-specific data. The scope of the function depends on whether you place the function at the root level of model or in a subsystem.
% 1. Open the model rtwdemo_comp or rtwdemo_comp_cpp.
% 2. See Generate Reentrant Code from Simulink Function Blocks.
% Copyright 2017 The MathWorks, Inc.