bounding Interpolation of scatter data to boundaries of the data
이전 댓글 표시
All of the examples I have seen involing scatterInterpolant use the meshgrid function, which seems to result in interpolating scatter data to a defined cubic volume.
My scattered data is of the shape of a dome, and would like to limit the interpolation to this shape. I want to interpolate this scattered data and display a 3d plot with slices, and use the interpolated output to color the data. I have gotten this to work, but am getting colors in the areas outside of the dome shape where there are no scatter points.
The current idea I have is to find the top surface bounding my data, and then set all outputs of the interpolation above the surface equal to NaN so as to not color them. Is there an easier way to do this? Is there an interpolating function that bounds to the given data, or could I define a mesh grid only for points under the surface of the dome?
Thanks in advance
댓글 수: 5
KSSV
2021년 7월 7일
I think the way is to make the points lying outside to NaN.
Scott MacKenzie
2021년 7월 7일
It might help if you posted your code and an example image demonstrating the issue of note.
"All of the examples I have seen involing scatterInterpolant use the meshgrid function"
They are just examples. There is absolutely no requirement for the interpolated points to lie on any grid, so you can simply define vectors of the points where you want to interpolate at, and provide those to the interpolation function.
Don't want points outside of the dome? Then don't interpolate them.
Stephen23
2021년 7월 7일
"but I think the problem lies in trying to setup the data for the slice function which takes data in meshgrid format."
That is a very different question to what you asked about.
If SLICE has specific requirements (I have not looked) e.g. it only works on gridded data, then of course that is what you will have to provide it with. As KSSV wrote, you could set values to NaN, which might give the effect you want.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!