function [X,Y] = selectModes(oneTrial,indices,class,CV)

if ~iscell(oneTrial)
  error('selectModes must be applied to cella array, but it is not.');
else
  X = [];
  Y = [];
  
  modespan = CV.parms.firstMode : CV.parms.firstMode + ...
      CV.parms.nModes - 1;
  for w = indices
    modes = oneTrial{w}(:,modespan);
    modes = reshape(modes,size(modes,1)*size(modes,2),1);
    X = [X modes];
    Y = [Y class];
  end
end


