50 likes | 460 Views
Experimental control in COGENT/MATLAB. Christian Ruff. COGENT and MATLAB. Cogent is a MATLAB-toolbox (set of functions and .dlls) that can be used for control of behavioural and neuroimaging experiments Cogent functions can: Control timing Display pictures Display words Play sounds
E N D
Experimental control in COGENT/MATLAB Christian Ruff
COGENT and MATLAB • Cogent is a MATLAB-toolbox (set of functions and .dlls) that can be used for control of behavioural and neuroimaging experiments • Cogent functions can: • Control timing • Display pictures • Display words • Play sounds • Collect responses • Control serial and parallel ports • Cogent runs in MATLAB (so that COGENT scripts can be set up as MATLAB functions, and can access all other MATLAB functions) • However, COGENT functions only run in a special ‘mode’ that has to be set up
How to obtain and run COGENT • Cogent is programmed at UCL (FIL and LON ), and is freely available at http://www.vislab.ucl.ac.uk/Cogent/ • All you have to do is: • download the zip-files • unpack the directory on your computer • put this directory on the MATLAB path (so that MATLAB finds the functions) • Cogent at present runs with all versions of MATLAB up to 7.1, but will be updated within the next month or so to also run with more recent versions • COGENT has its own excellent documentation (cogmanv125.pdf and G2UsrManv124.pdf for graphics functions) in the folder ‘Documents’ • There are also many example scripts (in the folder ‘samples’)
Structure of COGENT • There are two sets of COGENT-functions: • COGENT 2000: High-level functions for experimental control (covered here) • Low-level graphics functions (starting with cg*; covered in future sessions) • Every COGENT script should have a certain structure: (1) (Define experimental parameters) (2) Initialise cogent (3) Start cogent (4) Execute cogent commands (5) Terminate cogent • Errors can occur if (4) is attempted before (2) and (3)