Creating a Surface Fit for an incomplete 2D array

I have a largish nxm matrix of values, with certain random cell values missing (currently set as 0 inside the matrix, but this could be changed to something different). I need to apply a fit, preferebaly nth degree polynamial, to get a plane. Does anyone have any suggestions as to how to go about this?
I'm not the best with vectors/matricies in general and I seem to struggle particularly in MATLAB. I have tried using 'sftool' but it only seems to allow selection of vectors for the data, which seems illogical to me. Is there something I can do to counteract this?
Any help would be greatly appreciated.
Many thanks!

 Accepted Answer

Use the MATLAB File Exchange function "inpaint_nans"

1 Comment

Thanks, that's an interesting function. Ideally though a want a surface to be fitted as best as possible to the points, ideally as a polynomial.
I have fewer points known than missing so the type of interpolation used for that function isn't giving me the type of results that I would like. I believe something like the surface fitting tool would be ideal but I don't understand why I can't use it on a 2d array.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!