MATLAB Python

inputFunc_upDown

Syntax

[curr_val, sample_bin, quit] = inputFunc_upDown(device, last_val, respmap, input_args, trial_bin, sample_bin)

Description

INPUTFUNC_UPDOWN is a simple SPTB input_func used to raise and lower values based on keyboard input, constraining these values within a legal range. It provides some simple interactive functionality, and is also a good starting point for understanding how SPTB input_funcs work.

Usage

INPUTFUNC_UPDOWN keeps track of the current value on a scale, managing value state samples of arbitrary dimensionality (it can keep track of as few as one or arbitrarily many values on scales). To use INPUTFUNC_UPDOWN, supply standard input_func form of input and output arguments. In particular, use the syntax shown above with arguments: device: a keyboard device token (e.g., as provided by easyLaunch or getInputDevice). last_val: the recent history or initialization values of INPUTFUNC_UPDOWN, of size [n m], where n is an arbitrary number of prior rows, and n is an arbitrary number of dimensions. respmap: argument ignored input_args: the mode in which INPUTFUNC_UPDOWN functions are controlled by arguments passed through this cell array. Arguments are as follows: 1: cell array containing n 2-element cell arrays, where n is the number of dimensions handled by INPUTFUNC_UPDOWN. Element 1 of each cell array is the name of a key to increment values on the dimension, and element 2 is the name of a key to decrement values on that dimension. 2: a two-element numerical array, where element 1 is the lower bound of allowed values (across all dimensions) and element 2 is the upper bound. trial_bin: argument ignored sample_bin: As with all input_funcs, the sample bin is a cell array with two elements: an INPUT_BIN in position one, and a DISPLAY_BIN in position two. It is not actually used by this input func, but is expected by easyScale and may contain DISPLAY_BIN values. So, we let it pass through the function.

Example Usage

For example usage of INPUTFUNC_UPDOWN, please see demoEasyScale_bar and / or demoEasyScale_history.

Output

curr_val: a vector representing current values. sample_bin: the same sample_bin supplied as input (above). quit: a boolean that is always false.