Home > classes > @pzmodel > display.m

display

PURPOSE ^

DISPLAY overloads display functionality for pzmodel objects.

SYNOPSIS ^

function varargout = display(varargin)

DESCRIPTION ^

 DISPLAY overloads display functionality for pzmodel objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: DISPLAY overloads display functionality for pzmodel objects.

 CALL:        txt     = display(pzmodel)

 INPUT:       pzmodel - pole/zero model object

 OUTPUT:      txt     - cell array with strings to display the pole/zero model object

 M-FILE INFO: Get information about this methods by calling
              >> pzmodel.getInfo('dieplay')

              Get information about a specified set-plist by calling:
              >> pzmodel.getInfo('display', 'set')

 VERSION:     $Id: display.m,v 1.9 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     30-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % DISPLAY overloads display functionality for pzmodel objects.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: DISPLAY overloads display functionality for pzmodel objects.
0005 %
0006 % CALL:        txt     = display(pzmodel)
0007 %
0008 % INPUT:       pzmodel - pole/zero model object
0009 %
0010 % OUTPUT:      txt     - cell array with strings to display the pole/zero model object
0011 %
0012 % M-FILE INFO: Get information about this methods by calling
0013 %              >> pzmodel.getInfo('dieplay')
0014 %
0015 %              Get information about a specified set-plist by calling:
0016 %              >> pzmodel.getInfo('display', 'set')
0017 %
0018 % VERSION:     $Id: display.m,v 1.9 2008/09/04 15:29:31 ingo Exp $
0019 %
0020 % HISTORY:     30-01-2007 M Hewitson
0021 %                 Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 
0025 function varargout = display(varargin)
0026 
0027   %%% Check if this is a call for parameters
0028   if utils.helper.isinfocall(varargin{:})
0029     varargout{1} = getInfo(varargin{3});
0030     return
0031   end
0032 
0033   objs = utils.helper.collect_objects(varargin(:), 'pzmodel');
0034 
0035   txt = {};
0036 
0037   for i=1:numel(objs)
0038     banner = sprintf('---- pzmodel %d ----', i);
0039     txt{end+1} = banner;
0040 
0041     % get key and value
0042     name  = objs(i).name;
0043     g     = objs(i).gain;
0044     ps    = objs(i).poles;
0045     zs    = objs(i).zeros;
0046     np    = length(ps);
0047     nz    = length(zs);
0048 
0049     % display
0050     txt{end+1} = ['model:    ' name];
0051     txt{end+1} = ['gain :    ' num2str(g)];
0052     for j=1:np
0053       txt{end+1} = [sprintf('pole %03d: ', j) char(ps(j)) ];
0054     end
0055     for j=1:nz
0056       txt{end+1} = [sprintf('zero %03d: ', j) char(zs(j)) ];
0057     end
0058 
0059     banner_end(1:length(banner)) = '-';
0060     txt{end+1} = banner_end;
0061   end
0062 
0063   varargout{1} = txt;
0064 
0065   if nargout == 0
0066     for ii=1:length(txt)
0067       disp(txt{ii});
0068     end
0069   end
0070 
0071 end
0072 
0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0074 %                               Local Functions                               %
0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076 
0077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0078 %
0079 % FUNCTION:    getInfo
0080 %
0081 % DESCRIPTION: Get Info Object
0082 %
0083 % HISTORY:     11-07-07 M Hewitson
0084 %                Creation.
0085 %
0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0087 
0088 function ii = getInfo(varargin)
0089   if nargin == 1 && strcmpi(varargin{1}, 'None')
0090     sets = {};
0091     pl   = [];
0092   else
0093     sets = {'Default'};
0094     pl   = getDefaultPlist;
0095   end
0096   % Build info object
0097   ii = minfo(mfilename, 'pzmodel', '', utils.const.categories.output, '$Id: display.m,v 1.9 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0098 end
0099 
0100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0101 %
0102 % FUNCTION:    getDefaultPlist
0103 %
0104 % DESCRIPTION: Get Default Plist
0105 %
0106 % HISTORY:     11-07-07 M Hewitson
0107 %                Creation.
0108 %
0109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0110 
0111 function plo = getDefaultPlist()
0112   plo = plist();
0113 end
0114

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003