Interpolate a set of points

조회 수: 2 (최근 30일)
Q
Q 2019년 11월 11일
편집: Star Strider 2019년 11월 12일
Hi,the goal is to use these points to recreate the curved surface via spline interpolation in Matlab and compare with the CAD model.
I have tried using griddata and of course the figure wasnt even close to the original model. I tried using scatteredinterpolant function following matlab guide but I am confused at some time as I have no idea how to get a 3d curve as a result instead of slices. For the 'v', I am not sure but I assume that 'v' decides the type of interpolation.
My question is, how to create this surface using scatterdinterpolant function? or is there any other better ways to achieve this?
Thank you in advance.

채택된 답변

Star Strider
Star Strider 2019년 11월 11일
편집: Star Strider 2019년 11월 12일
I am not certain what you want.
The figure produced by this code appears quite similar to your original plot image:
D = readmatrix('data.xlsx');
xv = linspace(min(D(:,2)),max(D(:,2)), 250);
yv = linspace(min(D(:,3)),max(D(:,3)), 250);
[X,Y] = ndgrid(xv, yv);
Z = griddata(D(:,2), D(:,3), D(:,4), X, Y, 'cubic');
figure
mesh(X, Y, Z)
grid on
axis equal
view(125,15)
producing:
The z-scale is different (I use axis equal here, so the x, y, and z units are essentially the same), however they otherwise seem quite similar.
I do not understand the code image you posted, or what you are doing with the ‘v’ and ‘F’ assignments, since they do not appear to be relevant.
  댓글 수: 2
Q
Q 2019년 11월 11일
Thank you so much for your answer, it really helps alot!
Star Strider
Star Strider 2019년 11월 11일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by