function h=curtain(x, y, z, C);
%curtain.m--creates a curtain plot
%
%h=curtain(x, y, z, C);
%
%Plots the data in the matrix C as a curtain plot.  x and y
%specify the loction where the profiles were taken and z 
%contains the depth bins

[m,n]=size(C);

x=x(:)';
p=length(x);
if(p~=n);
	error('x must contain the same number of columns as C');
end
y=y(:)';
p=length(y);
if(p~=n);
	error('y must contain the same number of columns as C');
end

z=z(:);
p=length(z);
if(p~=m);
	error('z must contain the same number of rows as C');
end

X=ones(m,1)*x;
Y=ones(m,1)*y;
Z=z*ones(1,n);

h=surf(X,Y,Z,C);shading('interp');colorbar
