function [h,SingularWarn,covH] = freqresp_(sys,w)
% Computes frequency response over frequency grid.
% Note: Extend for IDLTI to compute actual covariance

% Copyright 1986-2014 The MathWorks, Inc.
sizes = size(sys);
h = zeros([sizes(1:2) , length(w) , sizes(3:end)]);
SingularWarn = false;
Data = sys.Data_;
for ct=1:numel(Data)
   [h(:,:,:,ct),InfResp] = fresp(Data(ct),w);
   SingularWarn = SingularWarn || InfResp;
end
covH = [];