function [Value,RespObj] = calcopt(varargin);
%CALCOPT calculates Plot Options for Margin Response Plots
%   Value = CALCOPT(Property,RespObj) calculates the values of the
%   Plot Options specified by Property for all systems in the Response
%   Object, RespObj. The values are returned as the cell array, Value, 
%   where each cell represents the results for each system in RespObj.
%
%   Value = CALCOPT(Property,RespObj,Index) calculates the values for
%   only the systems in RespObj for the indices in Index.
%
%   [Value,RespObj] = CALCOPT(Property,RespObj) also returns the 
%   Response Object with the Property value set to the calculated
%   value.

%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.3 $  $Date: 2000/06/14 20:10:04 $
%   Karen Gondoly 1-28-97.

ni=nargin;
error(nargchk(2,3,ni));

Property = varargin{1};
RespObj = varargin{2};

switch lower(Property),
case 'stabilitymarginvalue',
   Value = RespObj.StabilityMarginValue;
end % switch

% end ../@margplot/calcopt.m