I'm very new to MATLAB (and coding in general) so forgive me if I don't explain the problem well. Basically I have a large dataset from an experiment during which the analyzer equipment malfunctioned. I want to interpolate over a long section of data for 2 variables (VO2 and VCO2). Here's a sample of the data (VO2; starting with 3 good data points, 3 empty data points when the equipment malfunctioned, and then 3 data points following the empty cells that I don't believe are accurate):
I've tried this code so far:
x = 1:4076;
yVO2 = VO2(1:4076);
yVCO2 = VCO2(1:4076);
xq = x;
splineVO2 = spline(x,yVO2);
splineVCO2 = spline(x,yVCO2);
interpVO2 = ppval(splineVO2,xq);
interpVCO2 = ppval(splineVCO2,xq);
And the returned interpolated values match the original values. I've tried this same code with only cells I want to interpolate over (2407:2822) and I get the same result. I've also tried this same code but with xq as an input argument in the spline function ( splineVO2 = spline(x,yVO2,xq); ) and have gotten the same result.
I'm guessing I'm doing something wrong with defining xq but I'm not sure.
Thanks in advance!