How can I increase my dataset length by Interpolation?
28 次查看(过去 30 天)
显示 更早的评论
I want to increase my data set length from say 5571x1 to 5590x1 by interpolating it non linearly since this dataset is experimental and there is no fixed interval.
All i've experimented with is using 'interp' and 'interp1' but no luck so far.
采纳的回答
Ameer Hamza
2020-5-5
This is a simple example which interpolates the data using cubic interpolation
x = rand(5571, 1); % your signal
t = linspace(0, 1, numel(x));
n = 5590; % required length
t_ = linspace(0, 1, n);
x_ = interp1(t, x, t_, 'spline').'; % x_ has dimensions of 5590x1
2 个评论
Ameer Hamza
2020-5-5
You can try 'linear', 'pchip', or 'makima' in place of spline and see which fits your requirement.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!