To retrieve parts of the object or set their values, use the dot-properties of the @key class.

Individual keys or whole @key objects are required arguments for most @cortex methods.

object structure

Like all Matlab objects, a @key object is essentially a structure. Each key in the object has the following fields:

field

default

meaning

type

label

'noname'

the name of the key

character string

start

0

beginning of analysis window (ms offset from cue event)

integer scalar

finish

300

end of analysis window (ms offset from cue event)

integer scalar (>start)

cues

23

one or more events ("encodes") to which analysis windows lock on

array of unsigned integers
or -1 to include all

trials

-1

range of "absolute" trials (from 1 to c.trials)

relat (*)

-1

range of trial header values to match; a @cortex object trial will be included in the analysis if each of its trial header values is found in the corresponding key field;

in order to include all possible values for a header field, set the corresponding key field to -1

note that all @cortex methods internally call the function trialset to perform trial selection based on a key;

block

-1

cond

-1

rept

-1

type (**)

-1

given (**)

-1

resp (**)

0

(*) the relative_trial field contains the trial# recorded in the trial header. Within the same @cortex object, trial numbering restarts from 1 at the beginning of a new run. The field trials refers instead to the "absolute" trial number for the whole object, which spans 1:c.trials.

(**) the trial header fields related to behavioral response and trial outcome have created some confusion in the past, and should be interpreted as follows:

type_of_trial: a property of the condition; typically meant to indicate the expected behavioral response for that condition

given_response: the actual behavioral response (formerly and mistakenly referred to as 'expected')

More often, you will create objects based on a text file, as described in the 3rd syntax of the constructor

simple keys and complex keys

It is not always possible to specify with a single key all the trials that belong together in the analysis. For example, you might want to include in the same analysis trials of conditions [6:10], where the cue event is 25, and trials of conditions [16:20], where the cue event is 27. This can be accomplished by creating "complex" keys, i.e., keys composed of more than one subkey.

If two consecutive "keys" have the same label, they will actually be considered as subkeys of the same key. This can be done in the KEYFILE, as in the following example: