gap filling with liner interpolation

1 view (last 30 days)
Binu
Binu on 15 Oct 2019
Commented: Binu on 16 Oct 2019
Hi,
I have a data file (attached) which I need to fill gaps (here in -9999) by liner interpolation. Could anyone please help me with this.
Many thanks
  2 Comments
Matt J
Matt J on 15 Oct 2019
Getting answers in the forum is generally more efficient if you attach attach relevant variables in a .mat file, rather than in .xlsx format.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 15 Oct 2019
Edited: Matt J on 15 Oct 2019
A=xlsread('data.xlsx');
I=A==-9999;
J=find(~I);
B=A;
B(I)=interp1(J,A(J),find(I));

More Answers (0)

Categories

Find more on Interpolation 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!