-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmassConvertTRC2MAT.m
More file actions
45 lines (26 loc) · 948 Bytes
/
Copy pathmassConvertTRC2MAT.m
File metadata and controls
45 lines (26 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% massConvertTRC2MAT
% Description : This function converts all the TRC files in a give
% directory's first subdirectory
% Input: inputDir - path to the directory
% Output: None.
function massConvertTRC2MAT(inputDir)
if (inputDir(end)~='\')
inputDir(end+1) = '\';
end
% Add the eeglab path from Rachel's computer
pathdef;
subDirs = dir(inputDir);
% Go into all the directories in the given path
for i=1:length(subDirs)
% Skip non-directories
if ((~(subDirs(i).isdir))||(strcmp(subDirs(i).name,'.'))||(strcmp(subDirs(i).name,'..')))
continue;
end
filesInSubDir = dir([inputDir subDirs(i).name '\*.TRC']);
% Find all the files in each directory
for j=1:length(filesInSubDir)
autotrc2mat([inputDir subDirs(i).name '\' filesInSubDir(j).name]);
end
end
warning('Process complete. If you would like to, please delete all TRC files');
end