How to apply an interpolation between different 3d surfaces?

5 views (last 30 days)
%%plot segment1
s1x=Segment1new(:,3);
s1y=Segment1new(:,4);
s1z=Segment1new(:,5);
mins1x=min(s1x);
maxs1x=max(s1x);
mins1y=min(s1y);
maxs1y=max(s1y);
[S1X,S1Y]=meshgrid(mins1x:int:maxs1x,mins1y:int:maxs1y);
S1Z=griddata(s1x,s1y,s1z,S1X,S1Y);
mesh(S1X,S1Y,S1Z)
%%plot segment2
.......
There are total 5 segments of 3d surfaces in the X-Y-Z coordinate, I want to combine the 5 segments into one smooth plane.
Could anyone know how to do it?

Answers (1)

Stephen Jue
Stephen Jue on 12 May 2017
Hi,
The interp3 may be what you are looking for. Note that the inputs to this function have to be gridded, not scattered, data.
Alternatively, if you are looking for a flat plane to fit the data, you can do a least-squares fit of the scattered data. In that case, you can refer to this MathWorks Technical Support post.

Products

Community Treasure Hunt

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

Start Hunting!