function [p,q] = covar_(sys,w,rw)
%

% Copyright 1986-2014 The MathWorks, Inc.
[Ny,~] = iosize(sys);
Data = sys.Data_;
p = zeros([Ny Ny size(Data)]);
if nargout>1
   if isempty(Data)
      Nx = 0;
   else
      Nx = order(Data(1));
   end
   q = zeros([Nx Nx size(Data)]);
   for ct=1:numel(Data)
      [p(:,:,ct),q(:,:,ct)] = covar(Data(ct),w,rw);
   end
else
   for ct=1:numel(Data)
      p(:,:,ct) = covar(Data(ct),w,rw);
   end
end