Main Content

force

Apply force feedback to joystick axis

Since R2025a

    Description

    force(joystick,n,f) applies force feedback f to the joystick axis 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]

    Force feedback to be applied to joystick axis, specified as a scalar or a vector in the range [-1,1]. The number of elements in f should either match the number of elements of n, or f can be a scalar to be applied to all the axes specified by n. The force-feedback input provided to the joystick is a scaled value. This value is subsequently multiplied by the maximum force capability of the device.

    Example: f = 0.65

    Example: f = [0.65 -0.35]

    Version History

    Introduced in R2025a