How to Remove NaN (missing values) from 3d array, temporally and spatially?

1 view (last 30 days)
Dear all,
I have a 3 dimension array (longitude*latetude*time) which I was read from a NetCDF file. This array has some NaN values. My question is how to remove this NaN in all spatial and temporal dimensions?
I need to remove because I want to use gridinterpolant function in the next step.
My Matlab version is R2015a
Thank you all.
  2 Comments
Walter Roberson
Walter Roberson on 13 Oct 2019
Do you want to replace them with something?
Do you want to remove the entire row that they are on, in all of the panes?
Do you want to remove the entire column that they are on, in all of the panes?
Do you want to remove the entire timestep that they are on?
BN
BN on 13 Oct 2019
Edited: BN on 13 Oct 2019
I want to interpolate them and fill these gaps. Because I want to regrid my data. I think if NaNs exist, then interpolation can't be successful implement and if delete column or row my database get really small. Thanks

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 13 Oct 2019
I suggest you look in the File Exchange for inpaint_nans

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!