function z=addspace(ax,ay,as)

% ADDSPACE    Add an action space to a matrix grid.
%
%             Example: load as.dat;
%                      z=addspace(linspace(15,33,100),linspace(-35,-15,100),as);
%                      spy(z);
%
%             Christian C. Beardah 1996         

[x,y]=meshgrid(ax,ay);
z=zeros(size(x));
x=x(:);
y=y(:);
p=[x y];

in=inpoly(p,as);
in=reshape(in,size(z));
z=flipud(in);