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
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 ExchangeInterpolation についてさらに検索

質問済み:

2017 年 11 月 21 日

コメント済み:

2019 年 3 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by