forked from DeNardoLab/BehaviorDEPOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleanText.m
32 lines (29 loc) · 1.37 KB
/
cleanText.m
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
%removes non alpha-numeric characters
%INPUT: cell array
%OUTPUT: cell array with non alpha-numeric characters removed via strrep
function textcells = cleanText(textcells)
for i = 1:length(textcells) % remove inappropriate characters
textcells{i} = strrep(textcells{i},' ','');
textcells{i} = strrep(textcells{i},'-','');
textcells{i} = strrep(textcells{i},'/','');
textcells{i} = strrep(textcells{i},'\','');
textcells{i} = strrep(textcells{i},'+','');
textcells{i} = strrep(textcells{i},'=','');
textcells{i} = strrep(textcells{i},'*','');
textcells{i} = strrep(textcells{i},',','');
textcells{i} = strrep(textcells{i},'~','');
textcells{i} = strrep(textcells{i},'`','');
textcells{i} = strrep(textcells{i},'@','');
textcells{i} = strrep(textcells{i},'#','');
textcells{i} = strrep(textcells{i},'$','');
textcells{i} = strrep(textcells{i},'%','');
textcells{i} = strrep(textcells{i},'^','');
textcells{i} = strrep(textcells{i},'&','');
textcells{i} = strrep(textcells{i},'(','');
textcells{i} = strrep(textcells{i},')','');
textcells{i} = strrep(textcells{i},'|','');
textcells{i} = strrep(textcells{i},'<','');
textcells{i} = strrep(textcells{i},'>','');
textcells{i} = strrep(textcells{i},'?','');
end
end