Can interp1 function be used when the time interval of data isn't uniform?
Mostra commenti meno recenti
In the interp1 function, yi = interp1(x,Y,xi,method), I have x as time vector with non-uniform interval. But the length of x and Y vectors are same. Can I use the interp1 function to interpolate the data?
Risposta accettata
Più risposte (1)
Matt Fig
il 20 Ago 2012
When I have a question like this, I just do a little experiment.
x = sort(rand(1,30)*2*pi); % Non-uniform data
y = sin(x); % Underlying function
xi = 0:.25:2*pi; % Interpolation points
yi = interp1(x,y,xi,'spline');
plot(x,y,'*r',xi,yi,'b')
Categorie
Scopri di più su Interpolation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!