How to adapt interpolated 3D surfaces to the boundary of 2D data ?

1 view (last 30 days)
The MatLab FIT function sf=fit([x y],z); plot(sf,[x y],z) is very useful for estimating 3D surfaces. However, in the case of sparse data and polynomial fitting, It generates interpolates that are unsuitable outside the 2D data boundary. My question is "how to trim (cut) the parts of surface that are outside the 2D boundary". Here, an example of unsuitable border fitting ...

Answers (1)

KSSV
KSSV on 24 Aug 2017
doc griddata , scatteredinterpolant
  2 Comments
Rosanna
Rosanna on 24 Aug 2017
I would like solve the problem with the output of the FIT function (which has much more estimation options). I also tried to use k=boundary(x,y) and plot(sf(k),[x(k) y(k)],z(k)) ... but It does not work
Rosanna
Rosanna on 25 Aug 2017
Apart from the fact that "scatteredInterpolant" does not perform surface trimming outside of the data boundary ... rather, its older version "TriScatterInterp" (which will be dismissed by Matlab) does perform trimming ... hence, Why worsening this function?

Sign in to comment.

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!