I am trying to fill these NaNs following this rule: If there is a single NAN, I want the NAN to be filled in with the average of the numbers before and after. If there is more than one NAN. I want the NAN to be filled in with the nearest number. For example, row 2305 should be the average of 16.3 and 14.8, from 2298 to 2304 should be 16.3, and from 2306 to 2312 should be 14.8.
4 Comments
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817925
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817925
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817942
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817942
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817946
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817946
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817970
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/513936-fill-in-missing-nans#comment_817970
Sign in to comment.