Interpolate a set of points
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!