Main Content

Joystick Input

(To be removed) Process input from asynchronous joystick device

Joystick Input will be removed in a future release. For more information, see Version History.

  • Joystick Input block

Simulink 3D Animation


The Joystick Input block provides interaction between a Simulink® model and the virtual world associated with a Simulink 3D Animation™ block.

The Joystick Input block uses axes, buttons, and the point-of-view selector, if present. You can use this block as you would use any other Simulink source block. Its output ports reflect the status of the joystick controls for axes and buttons.

The Joystick Input block also supports force-feedback devices.



expand all

Provide the force-feedback to be applied along supported joystick axes.

The length of the Force vector corresponds to the number of joystick axes that support force-feedback.

To enable this port, you must first select the Enable force-feedback input parameter.

Data Types: double


expand all

The first joystick axes element is x, the second element is y, and so on up to the total number of axes. What the x axis represents depends on the type and shape of the joystick. The Joystick Input block uses the mapping between the joystick driver and the joystick.

Data Types: double

Status of joystick buttons.

Data Types: double

The output signal is the angle of the point-of-view selector, or POV Hat, in degrees from 0 to 360. If the selector is inactive, the signal is -1.

Data Types: double


expand all

You can find the properties of the joystick that is connected to the system in the Game Controllers section of the system Control Panel.

If you enable this parameter, the Simulink 3D Animation software dynamically adjusts the ports to correspond to the capabilities of the connected joystick each time that you open the model. If the connected device does not have force-feedback capability, selecting this check box causes the removal of the force-feedback input from the block, even if you enable the Enable force-feedback input parameter.

The block ports do not have the full widths provided by the Windows® Game Controllers interface.

If you select this check box, the Simulink 3D Animation software can support force-feedback joystick, steering wheel, and haptic (one that enables tactile feedback) devices.

When the Adjust I/O ports according to joystick capabilities parameter is enabled, the output ports change to correspond to the actual capabilities of the connected joystick. On Windows platforms, the output ports have fixed maximum width provided by the system Game Controllers interface.

Version History

Introduced before R2006a

collapse all

R2023b: To be removed

The Joystick Input block will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks in Unreal Engine Scenario Applications to interface MATLAB® and Simulink with the Unreal Engine® 3D simulation environment. To get started, see Get Started Creating Virtual World with Actors.