Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help ft_spiketriggeredaverage”.

  FT_SPIKETRIGGEREDAVERAGE computes the avererage of the LFP around the
  Use as
    [timelock] = ft_spiketriggeredaverage(cfg, data)
  The input data should be organised in a structure as obtained from
  the FT_PREPROCESSING function. The configuration should be according to
    cfg.timwin       = [begin end], time around each spike (default = [-0.1 0.1])
    cfg.spikechannel = string, name of single spike channel to trigger on      = Nx1 cell-array with selection of channels (default = 'all'),
                       see FT_CHANNELSELECTION for details
    cfg.keeptrials   = 'yes' or 'no', return individual trials or average (default = 'no')     = 'no', 'text', 'textbar', 'gui' (default = 'no')