GB_gtec_files_concatenation.m 806 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. function [alt_y, SR, MetaData] = GB_gtec_files_concatenation(file_tbc)
  2. % get the last session (final number +1)
  3. last_section = size(file_tbc,1);
  4. %
  5. alt_y = [];
  6. % for each chunk
  7. for k = 1:last_section
  8. % load the file
  9. sect{k} = load(file_tbc(k).name);
  10. alt_y = horzcat(alt_y, sect{k}.y);
  11. end
  12. % time channel is long as the sum of the timings
  13. alt_y(1,:) = [1:size(alt_y,2)];
  14. % new_file = struct;
  15. % new_file.y = alt_y;
  16. % new_file.SR = SR;
  17. %
  18. % if isfield(sect{end}, 'MetaData')
  19. % new_file.MetaData = sect{end}.MetaData;
  20. % end
  21. SR = sect{last_section}.SR;
  22. if isfield(sect{last_section}, 'MetaData')
  23. MetaData = sect{last_section}.MetaData;
  24. else
  25. MetaData = '';
  26. end
  27. end