function []=imagescnan1(varargin);
%-----------------------------------------------------
%usage: imagescnan1(X,Y,Z) or imagescnan1(Z)
%if only input Z, will plot 1:size(Z,1),1:size(Z,2),Z
%-----------------------------------------------------
nn=nargin;
if(nn~=3);
  if(length(nn)==1);Z=varargin{1};sz=size(Z);X=1:sz(1);Y=1:sz(2);
  else;fprintf('error: need [x,y,z] or [z]\n');
    return
  end
else;
  X=varargin{1};
  Y=varargin{2};
  Z=varargin{3};
end;

  h=imagesc(X,Y,Z);axis xy;
  set(h,'alphadata',~isnan(Z));

return
