Using gridfit to compute data for a hill chart
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello everyone,
smoothing a surface with the gridfit function found on FEX here seemed to me like a good way to "clean" up data in order to generate a clear hill chart. However gridfit extrapolates the data to the grid boundries, so the generated contour plot doesnt really look like its supposed to.
Is there a way to still use the smoothing of gridfit without extrapolating to the grid boundries? For example, this first image shows the mesh generated using Matlabs own meshgrid and griddata functions.
The next image shows the result of using gridfit with the exact same inputs.
As you can see, the 2nd mesh is not useable for a contour plot. So is there a way to use gridfit without extrapolating to the edges of the grid nodes, only smoothing the existing x,y,z values? I'm still somewhat new to Matlab and maybe I've just used the inputs/options in a wrong way?
Thanks for your help!
댓글 수: 0
채택된 답변
John D'Errico
2017년 8월 9일
편집: John D'Errico
2017년 8월 9일
Gridfit is designed to extrapolate, and to do so as smoothly as possible. That is how it is written, and you will not change it. There are no settings you can change in this matter. Sorry.
gridfit works on a rectangular lattice in the (x,y) plane. With a bit of programming expertise, you could triangulate that lattice, then carefully deal with those triangles that cross the convex hull. The result will be a new triangulation that lies entirely inside the convex hull of the data. It would take some work on your part though, and an understanding of how triangulations can be manipulated.
I can think of two other viable schemes to solve the problem. But if you insist on using a tool that will smooth the surface within the convex hull, then it will take some effort on your part.
추가 답변 (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!