Include Custom C++ Code in Stateflow
This demonstration shows how custom C++ files are used in a Stateflow model. You specify the name and location of the files by editing Simulation target or RTW target.
Open the Stateflow chart; during action of state ‘under_100’ uses adderOutput function, which exists in adder_cpp.cpp.