function h=cplot(varargin)
% simage Plot real and imag parts of complex array.
% Usage:: h=cplot(t,z,format)
%
% Plots real and imag parts of complex array and returns handle 

% revision history:
% 03/14/94 Mark D. Shattuck <mds> cplot.m  
% 03/08/95 mds return handle.  
% 04/07/21 update based on plotMat.m

if(~isempty(varargin))
  for n=1:nargin
    if(isnumeric(varargin{n}))
      if(~isreal(varargin{n}))
        varargin={varargin{1:n-1},[real(varargin{n});imag(varargin{n})]',varargin{n+1:end}};
      end
    end
  end
end
disp(varargin)
h=plot(varargin{:});
