App Design

Control the behavior of MATLAB® apps created in App Designer

Use Stateflow® to create state machines that define the behavior of MATLAB apps. Stateflow charts can monitor your interactions with an app and enable or disable app widgets accordingly. For charts in Simulink® models, use the keyword this to establish a bidirectional connection between the app and the chart, as illustrated in Model a Power Window Controller. For standalone charts in MATLAB, use the app startup callback to create a chart object that can communicate with the app, as illustrated in Design Human-Machine Interface Logic by Using Stateflow Charts.

Stateflow Syntax

thisAccess chart data during simulation

Topics

Connect Apps to Charts in Simulink Models

Model a Power Window Controller

Design an automotive power window system by using local events.

Simulate a Media Player

Use string data to define the behavior of a media player.

Model a Fitness Tracker

Implement a fitness tracker by using temporal logic and messages.

Connect Apps to Standalone Charts in MATLAB

Design Human-Machine Interface Logic by Using Stateflow Charts

Model the logic of a graphical user interface in a standalone Stateflow chart.

Model a Fitness App by Using Standalone Charts

Implement a fitness tracker by using multiple standalone charts and a MATLAB app.

Create an App for Analog Triggered Data Acquisition by Using Stateflow Charts

Create an analog-triggered data acquisition app by using Stateflow, Data Acquisition Toolbox™, and App Designer.