 function fA = SetUp(fname,a,b,n,c,d,m)
%         fA = SetUp(fname,a,b,n,c,d,m)
% sets up a matrix of f(x,y) evaluations
% fname is a string that names a function of the form f(x,y)
% a,b,c, and d are scalars that satisfy a<=b and c<=d. n and m are integers >=2
% fA is nXm matrix with the property that
%
% A(i,j) = f(a+(i-1)(b-a)/(n-1),c+(j-1)(d-c)/(m-1)), i = 1:n, j = 1:m

%x = linspace(a,b,n); y = linspace(c,d,m);
dx = (b-a)/n
dy = (d-c)/m
[x,y] = meshgrid(a:dx:b,c:dy:d);
fA = zeros(n+1,m+1);
for i = 1:n+1
   for j = 1:m+1
      fA(i,j) = feval(fname,x(i,j),y(i,j));
   end
end 