function LegendStr = legdstr(Cstr,LL,MM);
%LEGDSTR  Creates color/linestyle/marker legend for Response Object menus
%
%   LEGENDSTR = LEGDSTR(ColorStr,LineStyle,Marker) construct the legend
%   for the Systems menu in the LTI Viewer and response objects.

%   Copyright 1986-2000 The MathWorks, Inc. 
%   Karen Gondoly 1-27-98.
%   $Revision: 1.8 $

% Determine line style name
if get(0,'ScreenDepth')==1 % Monochrome screen
   Lind = find(strcmpi(LL,{'--';'-.';':';'-'}));
else
   % Solid = default (don't mention)
   Lind = find(strcmpi(LL,{'--';'-.';':'}));
end

if length(Lind)==1
   AllLines = {'dashed';'dash-dot';'dotted';'solid'};
   Lstr = AllLines{Lind};
else
   % Assume 'none'
   Lstr = '';
end      

% Set marker name
Mstr = MM;
if strcmp(Mstr,'none'), % Don't bother showing empty markerstyles
   Mstr = '';
end

% Construct legend string
LegendStr = Cstr;
if ~isempty(Lstr)
   LegendStr = sprintf('%s,%s',LegendStr,Lstr);
end
if ~isempty(Mstr),
   LegendStr = sprintf('%s,%s',LegendStr,Mstr);
end
