Is there a way to interp3 without interpolating the NaNs?

I have a 3D volume with some NaN values in it. I want to interpolate the the volume in order to fill in the NaNs and also extrapolate the volume around it. When I use the 'linear' method it doesn't replace the NaNs and seems to extrapolate them. When I try to use 'spline', I get an error "Insufficient finite values to interpolate." Not sure why.

 Accepted Answer

The fast and reliable https://www.mathworks.com/matlabcentral/fileexchange/4551-inpaint-nans is only documented to work in 2D, but I am told by a recent poster that it works on 3D as well, but that you will need to reshape the result back from 2D to 3D.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!