How to apply an interpolation between different 3d surfaces?
5 次查看(过去 30 天)
显示 更早的评论
%%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?
0 个评论
回答(1 个)
Stephen Jue
2017-5-12
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!