Integrating a 2D image plotting with non-uniform mesh(spacing)
7 views (last 30 days)
Show older comments
Hi,
I'm trying to calculate the net power of the surface by integrating the Poynting vector of each grid, but since the grid size isn't uniform, it's impossible to just add them up and multiply the total area. Is it possible to integrate a 2D image plotting with non-uniform mesh(spacing)?
Many thanks!

0 Comments
Accepted Answer
KSSV
on 21 Dec 2022
load('P_0_swg.mat')
x = lum.x ;
y = lum.y ;
Z = lum.z ;
[X,Y] = meshgrid(x,y) ;
xi = linspace(min(x),max(x),200) ;
yi = linspace(min(y),max(y),200) ;
[Xi,Yi] = meshgrid(xi,yi) ;
Zi = griddata(X,Y,Z',Xi,Yi) ;
pcolor(Xi,Yi,Zi)
shading interp
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!