Interpolation is wrong?
1 view (last 30 days)
I have a variable, 'wc_average' that I'd like to interpolate so it's the same size as another variable 'dep_cal2012'. Wc_average is about 78x1 and 'dep_cal2012' is about 977x1. The spacing between every point in wc_average is about every 10 minutes while the spacing between every measurement in dep_cal2012 is every nanosecond (there are about 7 measurements taken within the same second). I've tried interpolating wc_average with this code:
ix = linspace(1, numel(x), numel(y));
WC_interp = interp1(ix, y, 1:numel(x),'nearest'); WC_cap=WC_interp';
However, I've tried comparing the timeseries between the two and the interpolated one isn't right.
The code to run the figure:
What could be the reasoning behind the wrong interpolation? I've tried every method of interpolation and they all yield the same results.
KSSV on 15 Nov 2021
x=dep_cal2012; % 977x1
y=wc_average; % 78x1
ix = linspace(1, numel(y), numel(x));
WC_interp = interp1(1:numel(y), y,ix,'nearest');