Main Content

axis

Read status of joystick

Since R2025a

    Description

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

    Input Arguments

    collapse all

    Joystick object that interfaces a joystick device with the 3D environment, specified as a sim3d.io.Joystick object.

    Example: joystick = sim3d.io.Joystick(ID=1)

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

    Example: n = 1

    Example: n = [2 3]

    Output Arguments

    collapse all

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

    Version History

    Introduced in R2025a