% design_model.m

cond_names = {'a1b1','a1b2','a2b1','a2b2'};
ncond = length(cond_names);

cond_types = {'epochs','epochs','epochs','epochs'};

bf_ev_idx = zeros(1,ncond);
bf_ep_idx = ~bf_ev_idx;

nscan_per_cond = 20;

for icond = 1:ncond
  sot{icond} = (icond-1)*nscan_per_cond;
end

durs = {[], ...
      [], ...
      [], ...
      [] ...
      };

%
%  Model parameters
%

model = struct( ...
 'types',          1, ...		% specify and estimate
 'nsess',          2, ...
 'RT',             1, ...
 'nscans',         [80 80], ...
 'replicated',     1, ...
 'same_time_param', 1, ...
 'conditions_nb',  [ncond], ...     
 'conditions',     [1], ...
 'stochastics_flag', [0], ...
 'stochastics',    [], ...
 'parametrics_type', {{'none'}}, ...
 'parametrics',    [], ...
 'regressors_nb',  [0], ...
 'regressors',     [1], ... 
 'global_effects', {'none'}, ...
 'burst_mode',     0, ...
 'HF_fil',         'none',  ...
 'HF_cut',         [], ...
 'LF_fil',         'none', ...
 'LF_cut',         [], ...
 'int_corr',       'none', ... 
 'trial_fcon',     1, ...
 'now_later',      0, ...
 'stop_writing',   0, ...
 'files',          {{'blah'}} ...
);


regressors(1) = struct( ...
    'names', {'subject'}, ...
    'values', ones(40,1) ...
    );

%
%  Conditions structures
%

conditions(1) = struct( ...
 'names',   {cond_names}, ...
 'onsets',  {sot}, ...   
 'types',    {cond_types}, ... 
 'variable_dur', 0, ...
 'durations', {durs}, ...
 'bf_ev',   bf_ev_idx, ...
 'bf_ep',   bf_ep_idx, ...
 'volterra',  0 ...
);

%
%  Basis function structures
%

bf_ev(1) = struct( ...
  'ev_type', 1, ...
  'win_len', [], ...
  'order', [] ...
);

bf_ep(1) = struct( ...
  'ep_type', 4, ...
  'length', nscan_per_cond, ...
  'conv',  0, ...  
  'deriv', 0 ...
);


