LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
interpolate.m
1function interpolate(self)
2% interpolate all data across all the available timestamps
3tunion = [];
4
5for i=1:size(self.samples,1)
6 for r=1:size(self.samples,2)
7 for d=1:length(self.samples{i,r})
8 if ~isempty(self.samples{i,r}{d})
9 tunion = union(tunion, self.samples{i,r}{d}.t);
10 end
11 end
12 end
13end
14
15for i=1:length(self.samplesAggr)
16 for d=1:length(self.samplesAggr{i})
17 if ~isempty(self.samplesAggr{i}{d})
18 tunion = union(tunion, self.samplesAggr{i}{d}.t);
19 end
20 end
21end
22
23for i=1:size(self.samples,1)
24 for r=1:size(self.samples,2)
25 for d=1:length(self.samples{i,r})
26 if ~isempty(self.samples{i,r}{d})
27 % spline interpolation appears to be less
28 % sensitive to the number of samples
29 self.samples{i,r}{d}.data = interp1(self.samples{i,r}{d}.t, self.samples{i,r}{d}.data, tunion, 'spline');
30 self.samples{i,r}{d}.t = tunion;
31 end
32 end
33 end
34end
35
36for i=1:length(self.samplesAggr)
37 for d=1:length(self.samplesAggr{i})
38 if ~isempty(self.samplesAggr{i}{d})
39 % spline interpolation appears to be less
40 % sensitive to the number of samples
41 self.samplesAggr{i}{d}.data = interp1(self.samplesAggr{i}{d}.t, self.samplesAggr{i}{d}.data, tunion, 'spline');
42 self.samplesAggr{i}{d}.t = tunion;
43 end
44 end
45end
46
47end