function [z,nrk] = tzero(a,b,c,d,e,tol)
% Transmission zeros of state-space system.
%
%   For state-space models with matrices A,B,C,D,E, the transmission zeros
%   are the complex values s for which the rank of the matrix
%
%             [ A - s E   B]
%             [    C      D]
%
%   drops from its normal value. TOL is a relative tolerance controlling 
%   rank decisions.

%   Copyright 1984-2019 The MathWorks, Inc.

% Note: Low-level function, optimized for performance, minimal error checking.
ni = nargin;

% Defaults
if ni<6 || isempty(tol)
   tol = ltipack.getTolerance('rank');
elseif isnumeric(tol) && isreal(tol) && isscalar(tol) && tol>0
   tol = double(tol);
else
   error(message('Control:foundation:tzero3'))
end

% Compute zeros
[z,nrk] = mimozero(a,b,c,d,e,tol);
z = z(isfinite(z),:);
