function DF = checkDisplayFormat(sys,DF)
% Checks DisplayFormat/Variable compatibility

%   Copyright 1986-2010 The MathWorks, Inc.
if ~isempty(DF)
   if DF(1)=='r'
      % Store as default ([])
      DF = [];
   elseif any(DF(1)=='tf') && any(strcmp(sys.Variable,{'z^-1','q^-1'}))
      % Time Constant and Frequency formats not supported for z^-1 and q^-1
      if isstatic(sys)
         % Reset to avoid error when overriding Ts or Variable in static gains
         DF = [];
      else
         ctrlMsgUtils.error('Control:ltiobject:zpkProperties3',DF,sys.Variable)
      end
   end
end
