Main Content


Display button widget on device screen


Simulink Support Package for Android Devices / User Interface

  • Button block


Display a button widget on the device screen. The button has two states: pressed or not-pressed. Tapping the button switches its state.

The Button block outputs a boolean value. If the button state is Pressed, the block outputs 1. If the state is Not Pressed, the block outputs 0. The Button state parameter determines the button state when the app starts.

For simulations with no hardware connected, this block outputs the initial state.


Button state

The initial state of the button when the app starts.

Sample time

The frequency with which the button state is read and output.

Smaller values for Sample time require the processor to complete the same number of instructions in less time, which can cause task overruns.

Version History

Introduced in R2015a