Smooth out griddata results
이전 댓글 표시
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
Naomi Krauzig
2019년 3월 19일
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
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!