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!