6. creating @key objects

There are 3 ways to create a @key object:

  1. single-key object
  2. single-key default object
  3. multi-key object from text file

Syntax 1

A single-key @key object can be created interactively from the command line using:

key (label, start, finish, cues, conds, blocks, responses, trials, type, expected, repetition)

Example:
>> kobj = key ('test', -50, 150, 23, 1:10, -1, 0, -1, -1, -1, -1);

.creates a @key object for an analysis that will be labeled 'test', where spikes will be counted starting 50 ms before each occurrence of encode 23 and ending 150 ms after it; only correct trials of conditions 1 through 10 will be included.

Syntax 2

You can create a single-key @key object with all default values (see table above) by calling the constructor without arguments:

>> kobj = key

Syntax 3

To create a multi-key object call:

key (key_file)

.where key_file is the path and name of an ASCII file listing the parameters of one or more keys, according to the rules specified below.

Previous <-> Next