필터 지우기
필터 지우기

Help with scatteredInterpolant: masking and meshgrid alternatives

조회 수: 9 (최근 30일)
Brian
Brian 2014년 11월 25일
댓글: David Young 2014년 11월 26일
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.

답변 (1개)

David Young
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
Brian
Brian 2014년 11월 26일
This worked perfectly, thanks!
David Young
David Young 2014년 11월 26일
Oh good! You could accept the answer - flags up that it might be generally useful.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by