-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample1.m
More file actions
120 lines (110 loc) · 9.31 KB
/
example1.m
File metadata and controls
120 lines (110 loc) · 9.31 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
true_list = '/data/flow/isabel_all/2d/all8.list';
fitted_list = '/data/flow/isabel_all/2d/fitted_quad_endpoint/all8.list';
stderr_file = '/data/flow/isabel_all/2d/fitted_quad_endpoint/sampling8_00_stderr.raw';
global data_w data_d data_t data_h
fitted_list = load_list(fitted_list);
data_t = 9; % sampling+1
t_ary = 0:0.25:data_t-1.25; t_ary = t_ary';
true_raw_ary=[277.000000 189.000000 2.000000 0.000000; 266.678192 192.523453 2.000000 0.580089; 262.417450 193.763199 2.000000 0.830089; 258.255341 195.034210 2.000000 1.080089; 254.349625 196.423462 2.000000 1.330089; 250.690643 198.031982 2.000000 1.580089; 247.334488 199.785934 2.000000 1.830089; 244.281342 201.660126 2.000000 2.080089; 241.555420 203.620224 2.000000 2.330089; 239.245667 205.588394 2.000000 2.580089; 237.390671 207.546875 2.000000 2.830089; 235.918320 209.520844 2.000000 3.080089; 234.589905 211.634079 2.000000 3.330089; 233.287750 213.956680 2.000000 3.580089; 232.021210 216.479355 2.000000 3.830089; 230.988235 219.028015 2.000000 4.080089; 230.280350 221.456177 2.000000 4.330089; 229.902237 223.747421 2.000000 4.580089; 229.752396 225.894516 2.000000 4.830089; 229.712006 227.998230 2.000000 5.080089; 229.738312 230.039963 2.000000 5.330089; 229.895340 231.847702 2.000000 5.580089; 230.202759 233.259125 2.000000 5.830089; 230.602844 234.227798 2.000000 6.080089; 230.949387 234.970245 2.000000 6.330089; 231.202774 235.559479 2.000000 6.580089; 231.367065 235.993225 2.000000 6.830089; 231.430206 236.281204 2.000000 7.080089; 231.193909 236.606339 2.000000 7.330089; 230.621216 237.025467 2.000000 7.580089; 229.788788 237.525879 2.000000 7.830089];
uneven_t_ary = true_raw_ary(:,4);
true_x_ary = [interp1q(uneven_t_ary, true_raw_ary(:,1), t_ary) ...
interp1q(uneven_t_ary, true_raw_ary(:,2), t_ary)];
true_x_ary = true_x_ary';
% fit
[errstd1, errsum1, yy1, a, b, c] = quadfit_endpoint(t_ary,true_x_ary(1,:)',t_ary);
[errstd2, errsum2, yy2, a, b, c] = quadfit_endpoint(t_ary,true_x_ary(2,:)',t_ary);
z_ary = [yy1 yy2];
z_ary=z_ary';
z_stderr = [errstd1+errsum1; errstd2+errsum2]*20;
traced_fitted_x_raw_ary=[277.000000 189.000000 2.000000 0.000000; 270.213318 192.007141 2.000000 0.372303; 266.054840 194.034973 2.000000 0.622303; 262.291138 195.912231 2.000000 0.872303; 258.729797 197.691574 2.000000 1.122303; 255.573120 199.322205 2.000000 1.372303; 252.698425 200.776550 2.000000 1.622303; 250.036926 202.070847 2.000000 1.872303; 247.694748 203.362228 2.000000 2.122303; 245.551239 204.836823 2.000000 2.372303; 243.591751 206.060150 2.000000 2.622303; 241.763596 207.189560 2.000000 2.872303; 240.113464 208.398315 2.000000 3.122303; 238.590393 209.764603 2.000000 3.372303; 237.185089 211.207169 2.000000 3.622303; 235.937744 212.661102 2.000000 3.872303; 234.789429 214.189926 2.000000 4.122303; 233.664139 215.846298 2.000000 4.372303; 232.642029 217.598175 2.000000 4.622303; 231.777420 219.395782 2.000000 4.872303; 231.018707 221.252060 2.000000 5.122303; 230.325943 223.141037 2.000000 5.372303; 229.703842 225.017319 2.000000 5.622303; 229.131012 226.870895 2.000000 5.872303; 228.590973 228.713348 2.000000 6.122303; 228.070343 230.508774 2.000000 6.372303; 227.555878 232.218689 2.000000 6.622303; 227.046921 233.811066 2.000000 6.872303; 226.550812 235.273499 2.000000 7.122303; 226.037598 236.538895 2.000000 7.372303; 225.516800 237.598648 2.000000 7.622303; 224.983719 238.444641 2.000000 7.872303];
traced_fitted_x_ary = [interp1q(traced_fitted_x_raw_ary(:,4), traced_fitted_x_raw_ary(:,1), t_ary) ...
interp1q(traced_fitted_x_raw_ary(:,4), traced_fitted_x_raw_ary(:,2), t_ary)];
traced_fitted_x_ary=traced_fitted_x_ary';
trace_filtering
%
% true_list = '/data/flow/isabel_all/2d/all8.list';
% fitted_list = '/data/flow/isabel_all/2d/fitted_quad_endpoint/all8.list';
% stderr_file = '/data/flow/isabel_all/2d/fitted_quad_endpoint/sampling8_00_stderr.raw';
% global data_w data_d data_t data_h
%
% fitted_list = load_list(fitted_list);
%
% data_t = 9; % sampling+1
%
%
% % t
% t_ary=[ 0
% 0.580089
% 0.830089
% 1.080089
% 1.330089
% 1.580089
% 1.830089
% 2.080089
% 2.330089
% 2.580089
% 2.830089
% 3.080089
% 3.330089
% 3.580089
% 3.830089
% 4.080089
% 4.330089
% 4.580089
% 4.830089
% 5.080089
% 5.330089
% 5.580089
% 5.830089
% 6.080089
% 6.330089
% 6.580089
% 6.830089
% 7.080089
% 7.330089
% 7.580089
% 7.830089
% ];
%
% z_ary=[ 277 189
% 267.754170607917 193.839775270242
% 264.053148703663 195.864144376909
% 260.522974712254 197.851516930957
% 257.163648633692 199.801892932385
% 253.975170467976 201.715272381193
% 250.957540215105 203.591655277381
% 248.110757875081 205.43104162095
% 245.434823447902 207.233431411899
% 242.92973693357 208.998824650229
% 240.595498332083 210.727221335938
% 238.432107643442 212.418621469028
% 236.439564867648 214.073025049499
% 234.617870004699 215.690432077349
% 232.967023054596 217.27084255258
% 231.487024017339 218.814256475192
% 230.177872892928 220.320673845183
% 229.039569681363 221.790094662555
% 228.072114382644 223.222518927308
% 227.275506996771 224.61794663944
% 226.649747523744 225.976377798953
% 226.194835963563 227.297812405846
% 225.910772316228 228.58225046012
% 225.797556581738 229.829691961774
% 225.855188760095 231.040136910808
% 226.083668851298 232.213585307223
% 226.482996855346 233.350037151017
% 227.053172772241 234.449492442193
% 227.794196601981 235.511951180748
% 228.706068344568 236.537413366684
% 229.788788 237.525879]
% z_stderr = [3.10306661646616 2.94991771814256];
% z_ary=z_ary'; % time in second order of the matrix
% z_stderr = z_stderr';
%
% true_x_ary=[277.000000 189.000000 2.000000 0.000000; 266.678192 192.523453 2.000000 0.580089; 262.417450 193.763199 2.000000 0.830089; 258.255341 195.034210 2.000000 1.080089; 254.349625 196.423462 2.000000 1.330089; 250.690643 198.031982 2.000000 1.580089; 247.334488 199.785934 2.000000 1.830089; 244.281342 201.660126 2.000000 2.080089; 241.555420 203.620224 2.000000 2.330089; 239.245667 205.588394 2.000000 2.580089; 237.390671 207.546875 2.000000 2.830089; 235.918320 209.520844 2.000000 3.080089; 234.589905 211.634079 2.000000 3.330089; 233.287750 213.956680 2.000000 3.580089; 232.021210 216.479355 2.000000 3.830089; 230.988235 219.028015 2.000000 4.080089; 230.280350 221.456177 2.000000 4.330089; 229.902237 223.747421 2.000000 4.580089; 229.752396 225.894516 2.000000 4.830089; 229.712006 227.998230 2.000000 5.080089; 229.738312 230.039963 2.000000 5.330089; 229.895340 231.847702 2.000000 5.580089; 230.202759 233.259125 2.000000 5.830089; 230.602844 234.227798 2.000000 6.080089; 230.949387 234.970245 2.000000 6.330089; 231.202774 235.559479 2.000000 6.580089; 231.367065 235.993225 2.000000 6.830089; 231.430206 236.281204 2.000000 7.080089; 231.193909 236.606339 2.000000 7.330089; 230.621216 237.025467 2.000000 7.580089; 229.788788 237.525879 2.000000 7.830089];
% true_x_ary=true_x_ary';
%
% traced_fitted_x_ary=[277.000000 189.000000 2.000000 0.000000; 270.213318 192.007141 2.000000 0.372303; 266.054840 194.034973 2.000000 0.622303; 262.291138 195.912231 2.000000 0.872303; 258.729797 197.691574 2.000000 1.122303; 255.573120 199.322205 2.000000 1.372303; 252.698425 200.776550 2.000000 1.622303; 250.036926 202.070847 2.000000 1.872303; 247.694748 203.362228 2.000000 2.122303; 245.551239 204.836823 2.000000 2.372303; 243.591751 206.060150 2.000000 2.622303; 241.763596 207.189560 2.000000 2.872303; 240.113464 208.398315 2.000000 3.122303; 238.590393 209.764603 2.000000 3.372303; 237.185089 211.207169 2.000000 3.622303; 235.937744 212.661102 2.000000 3.872303; 234.789429 214.189926 2.000000 4.122303; 233.664139 215.846298 2.000000 4.372303; 232.642029 217.598175 2.000000 4.622303; 231.777420 219.395782 2.000000 4.872303; 231.018707 221.252060 2.000000 5.122303; 230.325943 223.141037 2.000000 5.372303; 229.703842 225.017319 2.000000 5.622303; 229.131012 226.870895 2.000000 5.872303; 228.590973 228.713348 2.000000 6.122303; 228.070343 230.508774 2.000000 6.372303; 227.555878 232.218689 2.000000 6.622303; 227.046921 233.811066 2.000000 6.872303; 226.550812 235.273499 2.000000 7.122303; 226.037598 236.538895 2.000000 7.372303; 225.516800 237.598648 2.000000 7.622303; 224.983719 238.444641 2.000000 7.872303];
% traced_fitted_x_ary=traced_fitted_x_ary';
%
% trace_filtering