function Extent = extent(Constr,iConstr)
%EXTENT  Returns bounding rectangle [Xmin Xmax Ymin Ymax]

%   Copyright 1986-2002 The MathWorks, Inc. 
%   $Revision: 1.1.6.2 $  $Date: 2004/12/10 19:30:48 $

if nargin < 2, iConstr = Constr.SelectedEdge; end
Extent = [...
   min(min(unitconv(Constr.Frequency(iConstr,:),Constr.FrequencyUnits,Constr.getDisplayUnits('XUnits')))), ...
   max(max(unitconv(Constr.Frequency(iConstr,:),Constr.FrequencyUnits,Constr.getDisplayUnits('XUnits')))), ...
   min(min(unitconv(Constr.Magnitude(iConstr,:),Constr.MagnitudeUnits,Constr.getDisplayUnits('YUnits')))), ...
   max(max(unitconv(Constr.Magnitude(iConstr,:),Constr.MagnitudeUnits,Constr.getDisplayUnits('YUnits'))))];