Interpolate a set of points
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Star Strider
il 11 Nov 2019
Modificato: Star Strider
il 12 Nov 2019
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!