MATLAB: Using interpolation to replace missing values (NaN)

后端 未结 6 888
一整个雨季
一整个雨季 2020-12-10 16:29

I have cell array each containing a sequence of values as a row vector. The sequences contain some missing values represented by NaN.

I would like to re

6条回答
  •  误落风尘
    2020-12-10 17:09

    Consider the following example

    X=some Nx1 array Y=F(X) with some NaNs in it

    then use

    X1=X(find(~isnan(Y))); Y1=Y(find(~isnan(Y)));

    Now interpolate over X1 and Y1 to compute all values at all X.

提交回复
热议问题