plot - How to use tri2grid matlab? -
i have problem tri2grid. have set of coordinate points on triangle , value of interest @ points (3 vectors). create grid using tri2grid command inside triangle , see solution (a matrix) on grid points. did following got in solution matrix (fgrid) nan values. read nan values occur when grid points outside original mesh create grid on same triangle of mesh, not understand why got nan values.anyone can help??
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);
you have nan values because rectangular grid defined on maximum x , y range of triangle contain points outside triangle. draw triangle on piece of paper, try drawing rectangle covers triangle, , you'll see issue quickly.
to see actual grid lies can plot out:
plot(xt,yt,'g.'); % triangle points hold on plot(xgrid,ygrid, 'r.'); % mesh points
the nan values not issue, depending on you're planning output.
Comments
Post a Comment