Could anyone help how should I use the interp1-function on MATLAB on data such as the following:
-99
3
1
7
10
10
22
29
-99
-99
25
26
60
142
78
124
74
26
13
18
The -99 data values correspond to error-values and I would like to interpolate them…advices? =) Thank you!
Not around Matlab at the moment but I reckon you could do something like this:
So in the code X and Y are the x and y coord vectors of the points you want to interpolate, i.e. your input points (without the errors!), and Xi is a vector of the location of the points you would like to interpolate values for (if you think about X being location and Y being value). The point Yi will be the interpolated values corresponding to Xi, which I think in this case will be your original vector with the -99 points replaced by linearly interpolated values. Funny stuff might happen at the edges :/ check the docs. Hope there are no errors.