![]() ![]() The actual data is some form of processed signals. If so, first use the fillmissing function (R2016b and later reseases), then interp1. NaN NaN 0.42639 -0.37281 -0.23645 2.0237 -2.2584 2.2294īased on the responses, I think there's been a confusion: obviously I'm not working with random data, the code shown above is simply an example of how the data is structured. Description Given (x,y,xp), this function computes the yp components corresponding to xp by the interpolation between known data provided by (x,y) nodes. Learn more about interpolate, missing values I have Matlab 2013, and I want to apply spline interpolation in my data matrix with NaN values. By default, the extrapolation is performed by splines when splines are used for the interpolation, and by padding with nan when the interpolation is linear or by 'nearest' node. ![]() I suspect you may be asking interp1 to interpolate values not within the range of the data, but that’s only a guess. I would like to replace all NaNs using some sort of interpolation method, how can I can do this in MATLAB? I am also open to other suggestions on how to deal with these missing values.Ĭonsider this sample data to illustrate the problem: seq = For the nearest, linear, and v5cubic methods, interp1(x,Y,xi,method) returns NaN for any element of xi that is outside the interval spanned by x. The sequences contain some missing values represented by NaN. I have cell array each containing a sequence of values as a row vector. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |