Home > classes > @pz > char.m

char

PURPOSE ^

CHAR convert a pz object into a string.

SYNOPSIS ^

function varargout = char(varargin)

DESCRIPTION ^

 CHAR convert a pz object into a string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CHAR convert a pz object into a string.

 CALL:        string = char(obj)

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

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

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

 HISTORY:     04-06-2008 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CHAR convert a pz object into a string.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CHAR convert a pz object into a string.
0005 %
0006 % CALL:        string = char(obj)
0007 %
0008 % M-FILE INFO: Get information about this methods by calling
0009 %              >> pz.getInfo('char')
0010 %
0011 %              Get information about a specified set-plist by calling:
0012 %              >> pz.getInfo('char', 'set')
0013 %
0014 % VERSION:     $Id: char.m,v 1.5 2008/09/04 15:29:31 ingo Exp $
0015 %
0016 % HISTORY:     04-06-2008 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 function varargout = char(varargin)
0022 
0023   % Check if this is a call for parameters
0024   if utils.helper.isinfocall(varargin{:})
0025     varargout{1} = getInfo(varargin{3});
0026     return
0027   end
0028 
0029   objs = utils.helper.collect_objects(varargin(:), 'pz');
0030 
0031   pstr = '';
0032   for ii = 1:numel(objs)
0033     pp   = objs(ii);
0034     % f and Q
0035     pstr = [pstr  sprintf('(f=%g Hz,Q=%g), ', pp.f, pp.q)];
0036   end
0037 
0038   %%% Prepare output
0039   varargout{1} = pstr(1:end-2);
0040 end
0041 
0042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0043 %                               Local Functions                               %
0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0045 
0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0047 %
0048 % FUNCTION:    getInfo
0049 %
0050 % DESCRIPTION: Get Info Object
0051 %
0052 % HISTORY:     11-07-07 M Hewitson
0053 %                Creation.
0054 %
0055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0056 
0057 function ii = getInfo(varargin)
0058   if nargin == 1 && strcmpi(varargin{1}, 'None')
0059     sets = {};
0060     pl   = [];
0061   else
0062     sets = {'Default'};
0063     pl   = getDefaultPlist;
0064   end
0065   % Build info object
0066   ii = minfo(mfilename, 'pz', '', utils.const.categories.output, '$Id: char.m,v 1.5 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0067 end
0068 
0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0070 %
0071 % FUNCTION:    getDefaultPlist
0072 %
0073 % DESCRIPTION: Get Default Plist
0074 %
0075 % HISTORY:     11-07-07 M Hewitson
0076 %                Creation.
0077 %
0078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0079 
0080 function plo = getDefaultPlist()
0081   plo = plist();
0082 end
0083 
0084

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