Main Content


Read status of joystick


a = axis(joy, n)


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