-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRemoveOutliersFromMultiple.m
More file actions
27 lines (23 loc) · 1.02 KB
/
RemoveOutliersFromMultiple.m
File metadata and controls
27 lines (23 loc) · 1.02 KB
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
function [cleantracescell,dirtytracescell,totaloutliers]=RemoveOutliersFromMultiple(tracescell,DoDisplay,DoSaveFig)
%Runs removeOutliers on multiple sets of data and throws them out of all
%sets if they need to be thrown out of one set
% cleantracescell Cell Array of only those traces that aren't thrown out by ANY of the sets
% dirtytracescell Cell Array of the bad traces for each
% outliers Those traces that were bad for ANY of the sets
number_of_sets=size(tracescell,2);
dirtytracescell=cell(1,number_of_sets);
cleantracescell=cell(1,number_of_sets);
totaloutliers=[];
%Run RemoveOutliers on each set
for i_c=1:number_of_sets
traces=tracescell{i_c};
[~,dirtytraces,outliers]=RemoveOutliers(traces,DoDisplay,DoSaveFig);
dirtytracescell{i_c}=dirtytraces;
totaloutliers=union(totaloutliers,outliers);
end
%Update the clean sets based on total outliers
for i_c=1:number_of_sets
traces=tracescell{i_c};
traces(:,totaloutliers)=[];
cleantracescell{i_c}=traces;
end