time.m 576 B

123456789101112131415161718192021222324
  1. function res = time(this, ind, format)
  2. % Method for getting the time axis
  3. % FORMAT res = time(this, ind, format)
  4. % _______________________________________________________________________
  5. % Copyright (C) 2008-2012 Wellcome Trust Centre for Neuroimaging
  6. % Vladimir Litvak, Stefan Kiebel
  7. % $Id: time.m 5025 2012-10-31 14:44:13Z vladimir $
  8. if this.Nsamples>0
  9. res = (0:(this.Nsamples-1))./this.Fsample + this.timeOnset;
  10. else
  11. res = [];
  12. end
  13. if nargin>1 && ~isempty(ind)
  14. res = res(ind);
  15. end
  16. if nargin > 2
  17. if strcmp(format, 'ms')
  18. res = res*1000;
  19. end
  20. end