Help with scatteredInterpolant: masking and meshgrid alternatives
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello, thanks for reading this,
I am asking about ways to view a 3D point cloud as surfaces. This is a follow up to an earlier question: what I have is a 4 column text file denoting a point cloud with one column denoting data that I use for color, and three column entries for x y and z coordinates.
Here is the code I used, to get an idea:
What I do right now (after looking online) is use scattered interpolation and apply the interpolation to a meshgrid, but there are problems with this approach. The problem is I am transitioning an irregular point cloud to a uniform mesh grid which I then surf to visualize. So, that being said, I can view a slice of the volume I have nicely, but the interpolation doesn't end at the boundaries of the volume: it goes to each end of the meshgrid I assign it to.
I was wondering: how can I create a similar meshgrid, but assign the surrounding region such that it isn't included when interpolating color? I think the problem arises when I try to create a meshgrid out of the interpolated data in line 23 of my code, and I think I can edit my code here to judge where to place NaN or actual data values, but I was wondering how I could do that properly.
I will attach a picture denoting what I mean as well.
Thanks for your advice.
댓글 수: 0
답변 (1개)
David Young
2014년 11월 25일
A quick thought - would it help to switch off extrapolation? Use
F = scatteredInterpolant(X,Y,Z,C,'nearest','none');
댓글 수: 2
David Young
2014년 11월 26일
Oh good! You could accept the answer - flags up that it might be generally useful.
참고 항목
카테고리
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!