display.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. function str = display(this)
  2. % Method for displaying information about an meeg object
  3. % FORMAT display(this)
  4. % _______________________________________________________________________
  5. % Copyright (C) 2008-2012 Wellcome Trust Centre for Neuroimaging
  6. % Vladimir Litvak
  7. % $Id: display.m 5025 2012-10-31 14:44:13Z vladimir $
  8. str = ['SPM M/EEG data object\n'...
  9. 'Type: ' type(this) '\n'...
  10. 'Transform: ' transformtype(this) '\n'...
  11. num2str(nconditions(this)), ' conditions\n'...
  12. num2str(nchannels(this)), ' channels\n'
  13. ];
  14. if strncmpi(transformtype(this),'TF',2)
  15. str = [str num2str(nfrequencies(this)), ' frequencies\n'];
  16. end
  17. str = [str ...
  18. num2str(nsamples(this)), ' samples/trial\n'...
  19. num2str(ntrials(this)), ' trials\n'...
  20. 'Sampling frequency: ' num2str(fsample(this)) ' Hz\n'...
  21. 'Loaded from file %s\n\n'
  22. ];
  23. if numel(this.montage.M)>0
  24. idx = montage(this,'getindex');
  25. str = [str ...
  26. num2str(montage(this,'getnumber')),' online montage(s) setup\n'...
  27. 'Current montage applied (0=none): ',num2str(idx),''];
  28. if idx
  29. str = [str ...
  30. ' ,named: "',montage(this,'getname'),'"\n\n'];
  31. else
  32. str = [str '\n\n'];
  33. end
  34. end
  35. if islinked(this)
  36. if strncmpi(transformtype(this),'TF',2)
  37. str = [str 'Use the syntax D(channels, frequencies, samples, trials) to access the data\n'];
  38. else
  39. str = [str 'Use the syntax D(channels, samples, trials) to access the data\n'];
  40. end
  41. else
  42. str = [str, 'There is no data linked to this header object\n'];
  43. end
  44. str = [str 'Type "methods(''meeg'')" for the list of methods performing other operations with the object\n'...
  45. 'Type "help meeg/method_name" to get help about methods\n'];
  46. str = sprintf(str, fullfile(this.path, this.fname));
  47. disp(str);