function [perfmarg,info,IRD] = robustperf(Dc,Opt,Need)
% Add PerformanceBlock with identifiable Name
%    In lftdataXXX, the IO is at the top of the .IC field, hence the
%    performance block goes at the top.

%   Author(s): MUSYN
%   Copyright 2010-2011 The MathWorks, Inc.
szD = iosize(Dc);
Fname = 'rcastreserved';
pblock = ltipack.LFTBlockWrapper(ucomplexm(Fname,zeros(fliplr(szD))));
Dc.Blocks = [pblock ; Dc.Blocks];

% Call ROBUSTSTAB on "extended" uncertain system
[stabmarg,info,IRD] = robuststab(Dc,Opt,Need);

% Fix return arguments for PERF (rather than STAB)
perfmarg = struct('LowerBound',stabmarg.LowerBound,...
   'UpperBound',stabmarg.UpperBound,...
   'CriticalFrequency',stabmarg.DestabilizingFrequency);
% Remove performance block
IRD.DestabilizingValue = rmfield(IRD.DestabilizingValue,Fname);
info.Sensitivity = rmfield(info.Sensitivity,Fname);
if Need.AllBadUncertainValues
   info.BadUncertainValues = rmfield(info.BadUncertainValues,Fname);
end
IDX = find(strcmp(Fname,IRD.BlockName));
IRD.BlockName(IDX,:) = [];
IRD.muB.BlkInfo(IDX,:) = [];
IRD.muB.muBlkNby2(IDX,:) = [];
IRD.muB.muBlkNby3(IDX,:) = [];
if Need.Sensitivity && ~isempty(IRD.SensText)
   IRD.SensText(IDX+1,:) = [];
end