function varargout=plotMat(varargin)
% plotMat <Plot matrix X=[x1;y1 x2;y2 ... xN;yN]>
% Usage:: h=plotMat(X1,[LineSpec][,...,Xn,[LineSpec]])
%         h=plotMat(...,'PropertyName',PropertyValue,...)
%

% revision history:
% 04/07/21 Mark D. Shattuck <mds> plotMat.m

%% Main

if(~isempty(varargin))
  N=nargin;
  n=1;
  while(n<=N)
    if(isnumeric(varargin{n}))
      [dim,~]=size(varargin{n});
      if(dim==2)
        varargin={varargin{1:n-1},varargin{n}(1,:),varargin{n}(2,:),varargin{n+1:end}};
        N=N+1;
      end
    end
    n=n+1;
  end
end
%disp(varargin)
h=plot(varargin{:});
if(nargout>0)
  varargout={h};
end

