Home > classes > @specwin > plot.m

plot

PURPOSE ^

PLOT plots a specwin object.

SYNOPSIS ^

function varargout = plot(ws, varargin)

DESCRIPTION ^

 PLOT plots a specwin object.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: PLOT plots a specwin object.

 CALL:            plot(specwin)
              h = plot(specwin)

 VERSION:     $Id: plot.m,v 1.5 2008/01/11 14:04:43 ingo Exp $

 HISTORY:     06-02-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = plot(ws, varargin)
0002 % PLOT plots a specwin object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: PLOT plots a specwin object.
0007 %
0008 % CALL:            plot(specwin)
0009 %              h = plot(specwin)
0010 %
0011 % VERSION:     $Id: plot.m,v 1.5 2008/01/11 14:04:43 ingo Exp $
0012 %
0013 % HISTORY:     06-02-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION  = '$Id: plot.m,v 1.5 2008/01/11 14:04:43 ingo Exp $';
0019 
0020 % Check if this is a call for parameters
0021 if nargin == 2
0022   if isa(ws, 'specwin') && ischar(varargin{1})
0023     in = char(varargin{1});
0024     if strcmp(in, 'Params')
0025       varargout{1} = plist();
0026       return
0027     elseif strcmp(in, 'Version')
0028       varargout{1} = VERSION;
0029       return
0030     end
0031   end
0032 end
0033 
0034 hl = [];
0035 
0036 hold on
0037 grid on;
0038 
0039 colors = getappdata(0,'ltpda_default_plot_colors');
0040 
0041 axes_h    = gca;
0042 titleStr  = '';
0043 legendStr = '';
0044 
0045 for i=1:numel(ws)
0046   w   = ws(i);
0047   hl  = [hl plot(w.win)];
0048   col = colors{mod(i-1,length(colors))+1};
0049   set(hl(end), 'Color', col);
0050   xlabel('sample');
0051   ylabel('amplitude');
0052   titleStr = [titleStr, ltpda_label(w.name), ', '];
0053   lstr = [sprintf('alpha = %g\n', w.alpha)...
0054           sprintf('psll = %g\n', w.psll)...
0055           sprintf('rov = %g\n', w.rov)...
0056           sprintf('nenbw = %g\n', w.nenbw)...
0057           sprintf('w3db = %g\n', w.w3db)...
0058           sprintf('flatness = %g\n', w.flatness)];
0059   legendStr = [legendStr cellstr(lstr)];
0060 end
0061 
0062 legend(legendStr);
0063 titleStr = titleStr(1:end-2);
0064 title(sprintf('Window: %s', titleStr));
0065 
0066 if nargout > 0
0067   varargout{1} = hl;
0068 end
0069 
0070 hold off
0071 
0072 % END

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003