function [stabmarg,info,IRD] = robuststab(Dc,Opt,Need)
% lftdataFRD/robuststab
%
% [StabMarg,Info,IRData] = ROBUSTSTAB(D,OPT,NEED,StabMarg,Info,IRData)
%     M is a scalar lftdataFRD object
%     OPT is a STRUCT with 5 fields:
%          Display ('off', 'on'), Sensitivity ('on', 'off'),
%          VaryUncertainty (number between 0 and 100),
%          Mussv (CHAR, 'sm9'), PadeN (positive integer).
%     NEED is a STRUCT with 4 fields, all LOGICAL valued based on what is
%     to be returned.  Fields are:
%          Report, Sensitivity, AllBadUncertainValues, Mussv4Info

%   Author(s): MUSYN
%   Copyright 2010-2011 The MathWorks, Inc.

[M,B,~,muB] = ulftdata(Dc); % M has no blocks, but is still lftdataFRD
if ~muB.ismuStandard
   % Structures with repeated, non-scalar blocks are not supported
   ctrlMsgUtils.error('Robust:analysis:OneIllegalRSRP')
end

% Call rsEngine
[stabmarg,DSV,info,SensText] = rsEngine(M,B,muB,Opt,Need);

% Report data
% Note: Assumed stable without internal delays since FRD
IRD = struct('StableFlag',true,'hasID',false,'SensText',SensText,'muB',muB,...
   'BlockName',{fieldnames(DSV)},'DestabilizingValue',DSV);
