function RespObj = newunits(RespObj,type,OldUnit);
%NEWUNITS  Apply changes to a response object due to a unit change
%
%   NEWUNITS(RespObj,type,OldUnit) applies the necessary changes to the
%   response object RespObj when there has been a unit change.  The type
%   of unit change is given in "type" and the old unit value is given in
%   "OldUnit".  NEWUNITS should only be called from the SET command of
%   the associated RespObj.

%   Authors: A. DiVergilio
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $  $Date: 2000/06/14 20:06:39 $

allProps = get(RespObj.response,'Undocumented');
LTIdisplayAxes = allProps.PlotAxes;

switch type
case 'frequency'
   %---Redraw grid
    if strcmp(allProps.Grid,'on')
       RespObj = plotgrid(RespObj);
    end
end

%---Delete all linescan markers in axes
linescan('deleteall',LTIdisplayAxes);

%---See if the units on the Array Selector need to be updated
RespCMenu = get(RespObj,'UIcontextMenu');
if isequal(get(RespCMenu.ArrayMenu,'Visible'),'on') & ishandle(get(RespCMenu.ArrayMenu,'UserData'))
   paramsel('#criterion',RespObj);          
end
