% Partial derivatives in X and Y directions
function [Gx,Gy] = Gradient(A);

X = [-1 0 1]/2; % filter
Y = [1 0 -1]'/2; % filter

Gx = filter2(X,A); % correlation
Gy = filter2(Y,A);
