Main Content

axis

(To be removed) Read status of joystick

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

Syntax

a = axis(joy, n)

Description

a = axis(joy, n) reads the status of joystick with axis number n.

Input Arguments

expand all

Joystick, specified as a vrjoystick object.

Axis number of joystick, specified as a scalar or a vector.

Output Arguments

expand all

Status of joystick axis, returned as a real positive scalar in the range [-1,1]. If n is a vector, multiple buttons are returned.

Version History

Introduced in R2007b

collapse all

R2023b: To be removed

The axis function 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.