MATLAB Python

makeMap

Syntax

map = makeMap([descriptors] [,values] [,inputs] [,map]) [] = optional parameters

Description

Because the various "map" objects used in SuperPsychToolbox are a little finicky, this function is provided to facilitate construction of respmap, condmap and stimmap objects while simultaneously doing all the requisite input checking. Alternately, when a fourth argument "map" is specified, this function switches into a validation mode to confirm that the structure of an existing map is valid, or to create a master condition map consisting of all condition permutations in the case of multiple condition factors. map is returned as a table data structure, or as a cell array of tables when multiple tables are supplied for the map argument.

Usage

descriptors: a cell array of strings describing each entry in the map. In a respmap, these correspond to the semantic meaning of each key response (e.g., 'yes' for key 'k'). In a condmap, these correspond to condition names (e.g., 'targets'). In a stimmap, these correspond to unique stimulus names (e.g., 'dog' or 'picture1.jpg'). If you do not want descriptors, leave this blank and default values will be used. If you specify both descriptors and values, there must be an equal number of entries in each. If you specify descriptors for a respmap, there must be as many entries as there are keys. values: a numeric array of values describing the value of each entry in the map. In a respmap, these correspond to the numeric meaning of each key response (e.g., 3 for key 'k'). In a condmap, these correspond to identifying condition numbers (e.g., 1 for 'targets'). In a stimmap, these correspond to unique stimulus values (e.g., 'dog' has a stimulus ID of 1). If values are left blank, default values will be used corresponding to 1:length(descriptors). If you specify both descriptors and values, there must be an equal number of entries in each. If you specify descriptors for a respmap, there must be as many entries as there are keys. You cannot supply values as the only non-empty argument. inputs: provide for a respmap only that will count as responses. Only these keys will exit the function. You should specify the allowed keys as a cell array (e.g., {'a','2','Space'}). Note that multiChoice is not case sensitive, but will nonetheless detect keys that would otherwise require a modifier (e.g., 'h' will match 'H', '4' will match '$') as well as special keys such as 'Return', 'Space' and 'LeftControl'. Can alternatively be provided as a numeric array, which specifies the bounding region of a correct response in easyCursor or easyScale. The numeric array must have an even number of entries, and should contain a pair of values for each dimension in the format: [a1, b1, c1, ..., a2, b2, c2, ...] map: an existing respmap, condmap, or stimmap to be submitted for validation. If descriptors, values, or inputs are supplied as well, the map is updated accordingly. If it is supplied as a cell array of maps (e.g., in the case of an experiment with multiple condition factors), descriptors, values, and inputs are silently ignored while each map is validated and a master map encompassing all permutations is returned as an additional entry in the cell array.

Output

map: the fully assembled and validated respmap table.