Create templates for common syntactical structures and simplify Simulink® models by using reusable functions. Graphical functions encapsulate flow charts containing if-then-else, switch-case, for, while, or do-while patterns. Use MATLAB functions to write matrix-oriented algorithms and call MATLAB functions for data analysis and visualization. Simulink functions call Simulink subsystems directly to streamline design and improve readability. Truth tables represent combinational logic for decision-making applications such as fault detection and mode switching. Reuse state components in multiple charts by using atomic subcharts. Incorporate custom code written in C or C++ to augment the capabilities of your Stateflow® chart.