Smooth out griddata results
Mostrar comentarios más antiguos
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 comentario
Naomi Krauzig
el 19 de Mzo. de 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
Respuestas (0)
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!