function [delx,dely] = grad_wall_staggered(P,dx,dy)
% GRADIENT Approximate gradient for channel cyclic in x.  
% [FX,FY] = GRAD(F,dx,dy) returns the numerical gradient of the
% matrix F. FX corresponds to dF/dx, the differences in the
% x (column) direction. FY corresponds to dF/dy, the differences
% in the y (row) direction. The spacing between points in the x and y
% directions is assumed to be dx and dy respectively.  
[n,p] = size(P);
% compute y component of gradient
% Take staggered differences on interior points

dely(1:n-1,:) = (P(2:n,:)-P(1:n-1,:))/(dy);
% compute x component of gradient 
delx(:,1:p-1)= (P(:,2:p)-P(:,1:p-1))/(dx);

delx(:,p)=0;
dely(n,:)=0;
