The attached model contains four common methods for accessing lookup tables within Stateflow. The four examples consist of using a Simulink® block in Stateflow, Embedded MATLAB™ functions in Stateflow, calling a function triggered Simulink subsystem in Stateflow, and including C-code in Stateflow. This is demonstrated in the model interp_1d_examples_r2008b.mdl.
If you are using a version of Stateflow prior to version 7.2 R2008b, you can still call lookup tables using three methods such as using Embedded MATLAB functions in Stateflow, calling a function triggered Simulink subsystem in Stateflow, and including C-code in Stateflow. This is demonstrated in the model interp_1d_examples.mdl.
There is no dependence on whether you use a flow chart or a state diagram for these examples. Each case would support both. Thanks for the question.
Chris, Wonder why to use state in 2 cases and a flow chart in the 3rd in the example. Like to see a comment so there is no confusion.
Added copyright information.
Updated copyright information.
Added an example to demonstrate how to use Simulink blocks in Stateflow.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.