% TRIAL_OPEN  Load a trial list from EEP 3.0 files.
%   [TRIAL_HANDLE, COND, START, CLASS, LENGTH]
%           = TRIAL_OPEN(CNT_HANDLE, CFG_NAME, TRG_NAME, REJ_NAME)
%
%   CNT_HANDLE     -  the thing you got from CNT_OPEN
%   CFG_NAME       -  name of a cntaverage configuration file
%   TRG_NAME       -  name of a trigger file
%   REJ_NAME       -  name of a rejection file
%
%   TRIAL_HANDLE   -  to access the prepared list
%   COND           -  vector of condition indices 
%   START          -  vector of trial start points (in samples)
%   CLASS          -  vector of trial classifications
%                      0 - good
%                      1 - move     (not implemented)
%                      2 - blink    (not implemented)
%                      3 - rejected
%   LENGTH         -  length of each trial
%
%   TRIAL_OPEN builds a list of trials exactly as the EEP 3.0 module
%   "cntaverage" would do. The list is returned in simple (M x 1) vectors.
%   Use the vectors to find the interesting trials and pass their index
%   into the TRIAL_LOAD function.
%   The CNT_HANDLE is now referenced in TRIAL_HANDLE and may not be closed
%   before the corresponding TRIAL_CLOSE call!
%   If an empty string is passed as REJ_NAME, no file is loaded. Trial 
%   rejection is caused by signal discontinuities only in this case.
%
% See also TRIAL_LOAD, TRIAL_CLOSE, CNT_OPEN, CNT_LOAD, CNT_CLOSE.
%
% MPI of Cognitive Neuroscience Leipzig
% MPI/ANT(eeprobe@ant-software.nl) 1998
