Merge branch 'fixf'
[wrf-fire-matlab.git] / fft / mlap.m
blob7fbaf516953c3b858fe87c833ab9fba5da1fc40b
1 function y=mlap(x,h)\r
2 % evaluate y=-x_11 - x_22 on rectangular uniform grid\r
3 % it is assumed that boundary values of x are zero\r
4 [m0,n0]=size(x);\r
5 xx=zeros(m0+2,n0+2);\r
6 xx(2:m0+1,2:n0+1)=x;\r
7 [m,n]=size(xx);\r
8 y=zeros(m0,n0);\r
9 mid1=2:m-1;\r
10 mid2=2:n-1;\r
11 y=(2*xx(mid1,mid2)-xx(mid1-1,mid2)-xx(mid1+1,mid2))/(h(1)*h(1))...\r
12   +(2*xx(mid1,mid2)-xx(mid1,mid2-1)-xx(mid1,mid2+1))/(h(2)*h(2));