-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRCB_cleanValues.m
More file actions
48 lines (40 loc) · 1.22 KB
/
Copy pathRCB_cleanValues.m
File metadata and controls
48 lines (40 loc) · 1.22 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% This function will take in what we plan on plotting as plotX and plotY,
% and filter out some of the data that seems as if it doesn't belong.
function [cleanPlotX, cleanPlotY] = RCB_cleanValues(plotX, plotY, plotMode, plotPrecision)
diffPlotX = abs(diff(plotX));
diffPlotY = abs(diff(plotY));
% Experimental precision factor (I don't know if it actually works)
if(plotPrecision)
diffPlotX(length(diffPlotX) + 1) = 0;
diffPlotY(length(diffPlotY) + 1) = 0;
diffPlotX = abs(diff(diffPlotX));
diffPlotY = abs(diff(diffPlotY));
end
cleanPlotX = [];
cleanPlotY = [];
varX = 0;
varY = 0;
switch(plotMode)
case 0
varX = 10;
varY = 0.1;
case 1
varX = 10;
varY = 0.1;
case 2
varX = 100;
varY = 100;
case 3
varX = 100;
varY = 100;
case 4
varX = 10;
varY = 0.1;
end
for i = 1:length(diffPlotX)
if(diffPlotX(i) < varX && diffPlotY(i) < varY)
cleanPlotX(length(cleanPlotX) + 1) = plotX(i);
cleanPlotY(length(cleanPlotY) + 1) = plotY(i);
end
end
end