-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasedif.m
50 lines (39 loc) · 1021 Bytes
/
basedif.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
data = textread('ctrl myl 1.2.4.txt');
trace = mat2cell(data, [2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000], [2]);
new = [];
menf = [];
nw = [];
medf = [];
for j = 1:2000
for i=1:50
y = trace{i,1} (j,:);
new = [new;y];
end
men = mean(new);
menf = [menf;men];
end
for k = 1:2000
for i=1:50
w = trace{i,1} (k,:);
nw = [nw;w];
end
med = median(nw);
medf = [medf;med];
end
figure(1)
plot(data(:,1), data(:,2))
figure(2)
plot(trace{1,1} (:,1), menf(:,2))
Xmean = trace{1,1} (:,1);
Ymean = menf(:,2);
basediff1 = mean (Ymean(1:800));
basediff2 = mean (Ymean(100:800));
basedy1 = Ymean - basediff1;
basedy2 = Ymean - basediff2;
figure(3)
subplot(1, 3, 1);
plot(Xmean, Ymean)
subplot(1,3,2);
plot (Xmean, basedy1)
subplot(1,3,3);
plot (Xmean, basedy2)