Smooth out griddata results

1 vue (au cours des 30 derniers jours)
Pedro Torres
Pedro Torres le 21 Nov 2017
Commenté : Naomi Krauzig le 19 Mar 2019
I have a set of velocity values and coordinates exported from ANSYS Fluent (in vector form), and want to interpolate the into a grid. I have done this with a couple of other experiments, with no issues, but this time this is producing confusing results, and the contour plot doesn't give out smooth results.
A = dlmread(fileName,'', 1, 1);
xa=A(:,1);
ya=A(:,2);
u=A(:,3);
v=A(:,4);
dx = 6.25E-5;
[x,y]=meshgrid(0:dx:0.05, 0:dx:0.01);
vx = griddata(xa,ya,u,x,y);
vy = griddata(xa,ya,v,x,y);
This produces a contourf(vx) like so:
What can I do to smooth out this interpolation?
  1 commentaire
Naomi Krauzig
Naomi Krauzig le 19 Mar 2019
Hello Pedro,
you can try to change the method during the gridding:
vx = griddata(xa,ya,u,x,y,'cubic');
vy = griddata(xa,ya,v,x,y,'cubic');
the interpolation method can be'linear', 'nearest', 'natural', 'cubic', or 'v4'.
The default method is 'linear' and the 'cubic' one usually smooths the results a bit but you should take a look and pick one that best suits your needs.
Hope that helps a bit,
Naomi

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by