how to resample non-linear breath-by-breath data (so inconsistant time)
Show older comments
Hi all,
I have a question regarding my data (example random numbers). If the subject had two breaths within a second there are two datapoints at the same time value. I think the biggest problem is the non-linearity of the data?
x=[0 1 2 5 7 8 9 15 19 20 21 22 23 24 27 30 31 32 33 34 35 36 36 38]
y=[1 2 5 3 4 8 6 5 8 5 8 6 85 85 66 44 55 66 88 77 99 88 55 66]
However, I need to resample to a 5 second time scale with it's resampled y data
x2=[0 5 10 15 20]
I wanted to use timeseries but this gave me the following error:
Warning: Cannot extrapolate
> In tsinterp>linearinter (line 145)
In tsinterp>localInterpolate (line 240)
In tsinterp (line 89)
In tsarrayFcn (line 26)
In tsdata.interpolation/interpolate (line 72)
In timeseries/resample (line 106)
Accepted Answer
More Answers (1)
KFrenkie
on 12 Feb 2016
Edited: Walter Roberson
on 13 Feb 2016
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!