function CompHandles = comphandles(Editor,flag)
%COMPHANDLES  Returns handles of compensator poles and zeros.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $  $Date: 2000/06/14 20:19:40 $

HG = Editor.HG;

if strcmpi(flag,'mag')
   % Compensator handles for magnitude plot
   CompHG = HG.Compensator.Magnitude;
else
   % Compensator handles for phase plot
   CompHG = HG.Compensator.Phase;
end

% Build vector of comp. handles
if isempty(CompHG)
   CompHandles = zeros(0,1);
else
   CompHandles = get(CompHG,{'Zero','Pole','Extra'}); ...
   CompHandles = unique(cat(1,CompHandles{:}));
end

