Griddata is omitting boundary data

5 vues (au cours des 30 derniers jours)
Abhijeet Marekar
Abhijeet Marekar le 21 Nov 2018
I am trying to plot 3d mesh plot using grid data. I have imported x,y, z cordinate data from .txt file. I am unable to fiugure out why grid data is omiting data on corner. See the image attached. I plotted 3d scttered data using plot3 comand to ensure there exist data, which is denoted by circles. I have 403 nodes and its x,y,z coordinates.
my programme is as follows.
x=disp(:,1); %x-cordinates of data point
y=disp(:,2); %y-cordinates of data point
z=disp(:,3); %z-cordinates of data point
[xq,yq]=ndgrid(0:0.01:0.3, 0:0.005:0.06);%mesh grid
vq= griddata(x,y,z,xq,yq);
figure
mesh(xq,yq,vq);
hold on;
plot3(x,y,z,'o');
  2 commentaires
Walter Roberson
Walter Roberson le 21 Nov 2018
difficult to say without the data .
Abhijeet Marekar
Abhijeet Marekar le 21 Nov 2018
My professor helped me with the problem. Matrix generated by ''griddata'' had 'NaN' values at some boundary points. These bounday points were outside of convex hull of griddata. I used ''scatteredInterpolant'' to extrapolate data and it worked.
m=0:0.01:0.3;
n=0:0.005:0.06;
[xq,yq] = ndgrid(x,y);
F = scatteredInterpolant(x,y,z,'nearest');
[a,b] = ndgrid(m,n);
vq = F(a,b);
figure
surf(a,b,vq);
@Walter Roberson thank you for your attention..!!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics and Optimization dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by