How to use tri2grid?

8 views (last 30 days)
Ceren GURKAN
Ceren GURKAN on 27 Jun 2014
Hello everybody,
I have a problem with tri2grid. I have a set of coordinate points on a triangle and the value of interest at those points (3 vectors). I would like to create a grid using tri2grid command inside my triangle and see my solution (a matrix) on the grid points. I did the following but I got in my solution matrix (fGrid) NaN values. I read that NaN values occur when your grid points are outside the original mesh but I create the grid on the same triangle of the mesh, do not really understand why I got those NaN values.Anyone can help??
if true
Xt=[zgauss(:,1)];
Yt=[zgauss(:,2)];
tri = delaunay(Xt,Yt);
xGrids = linspace(min(Xt),max(Xt),100);
yGrids = linspace(min(Yt),max(Yt),100);
[Xgrid,Ygrid]=meshgrid(xGrids,yGrids);
fGrid = tri2grid([Xt,Yt]',tri',f_on_gauss,Xgrid,Ygrid);
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!