필터 지우기
필터 지우기

scatterInterpolant doesn't work

조회 수: 2 (최근 30일)
Tianshu Yu
Tianshu Yu 2019년 7월 9일
I have a tetrahedral mesh. I want to plot a contour of its surface. I first test it on a mesh. But the scatterInterpolant return me some nonsense. Below is my code. I also include the picture of the interpolated surface and the pdeplot.
See, that is far from a smooth surface. I don't know why. If anyone know how to generate a contour out of this scatter plot I would be very grateful.
Below is the code. I have save the meshobject in the meshdata.mat, which is attached above.
model = createpde;
importGeometry(model, 'virus_3.stl');
figure(1)
pdegplot(model,'FaceLabels','on')
meshobject = generateMesh(model);
nodes = meshobject.Nodes;
nodesID = findNodes(meshobject, 'region', 'Face', [3, 7]);
surfNodes = nodes(:, nodesID);
surfNodes = surfNodes';
F = scatteredInterpolant(surfNodes(:,1),surfNodes(:,2),surfNodes(:,3));
[xq,yq] = meshgrid(0:12, 0:12);
F.Method = 'natural';
vq2 = F(xq,yq);
figure(2)
plot3(surfNodes(:,1),surfNodes(:,2),surfNodes(:,3),'mo')
hold on
mesh(xq,yq,vq2)
title('Linear')
legend('Sample Points','Interpolated Surface','Location','NorthWest')
hold off

답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by