Main Content

axis

Read status of joystick

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