function out=rdivx(A,DO)

if nargin<2; error('Error - Not enough input parameters specified'), end;
if nargin>2; error('Error - too many input parameters specified'), end;

D=size(A);
NN=D(1,1); N=D(1,2);

if length(DO)>N;error('Error - vector of domain values has too large of dimensions'),end;
if length(DO)<N;error('Error - vector of domain values has too small of dimensions'),end;


for m=1:1:NN
    out(m,1)= (A(m,2)-A(m,1))/(DO(2)-DO(1));
    out(m,N)= (A(m,N)-A(m,N-1))/(DO(N)-DO(N-1));
end

for m=2:1:N-1
    for n=1:1:NN
        out(n,m)=(A(n,m+1)-A(n,m-1))/(DO(m+1)-DO(m-1));
    end
end



    
    