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.html,v 1.14 2008/03/31 10:27:32 hewitson 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.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $
0012 %
0013 % HISTORY:     06-02-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION  = '$Id: plot.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $';
0019 CATEGORY = 'Output';
0020 
0021 % Check if this is a call for parameters
0022 if nargin == 2
0023   if isa(ws, 'specwin') && ischar(varargin{1})
0024     in = char(varargin{1});
0025     if strcmp(in, 'Params')
0026       varargout{1} = plist();
0027       return
0028     elseif strcmp(in, 'Version')
0029       varargout{1} = VERSION;
0030       return
0031     elseif strcmp(in, 'Category')
0032       varargout{1} = CATEGORY;
0033       return
0034     end
0035   end
0036 end
0037 
0038 hl = [];
0039 
0040 hold on
0041 grid on;
0042 
0043 colors = getappdata(0,'ltpda_default_plot_colors');
0044 
0045 axes_h    = gca;
0046 titleStr  = '';
0047 legendStr = '';
0048 
0049 for i=1:numel(ws)
0050   w   = ws(i);
0051   hl  = [hl plot(w.win)];
0052   col = colors{mod(i-1,length(colors))+1};
0053   set(hl(end), 'Color', col);
0054   xlabel('sample');
0055   ylabel('amplitude');
0056   titleStr = [titleStr, ltpda_label(w.name), ', '];
0057   lstr = [sprintf('alpha = %g\n', w.alpha)...
0058           sprintf('psll = %g\n', w.psll)...
0059           sprintf('rov = %g\n', w.rov)...
0060           sprintf('nenbw = %g\n', w.nenbw)...
0061           sprintf('w3db = %g\n', w.w3db)...
0062           sprintf('flatness = %g\n', w.flatness)];
0063   legendStr = [legendStr cellstr(lstr)];
0064 end
0065 
0066 legend(legendStr);
0067 titleStr = titleStr(1:end-2);
0068 title(sprintf('Window: %s', titleStr));
0069 
0070 if nargout > 0
0071   varargout{1} = hl;
0072 end
0073 
0074 hold off
0075 
0076 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003