Home > classes > @miir > string.m

string

PURPOSE ^

STRING writes a command string that can be used to recreate the input filter object.

SYNOPSIS ^

function varargout = string(varargin)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input filter object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: STRING writes a command string that can be used to recreate the
              input filter object.

 CALL:        cmd = string(miir)

 INPUTS:      cmd  - IIR filter object

 OUTPUTS:     miir - command string to create the IIR filter object

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

              Get information about a specified set-plist by calling:
              >> miir.getInfo('string', 'None')

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

 HISTORY:     29-03-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % STRING writes a command string that can be used to recreate the input filter object.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0005 %              input filter object.
0006 %
0007 % CALL:        cmd = string(miir)
0008 %
0009 % INPUTS:      cmd  - IIR filter object
0010 %
0011 % OUTPUTS:     miir - command string to create the IIR filter object
0012 %
0013 % M-FILE INFO: Get information about this methods by calling
0014 %              >> miir.getInfo('string')
0015 %
0016 %              Get information about a specified set-plist by calling:
0017 %              >> miir.getInfo('string', 'None')
0018 %
0019 % VERSION:     $Id: string.m,v 1.9 2008/09/04 15:29:31 ingo Exp $
0020 %
0021 % HISTORY:     29-03-2007 M Hewitson
0022 %                 Creation
0023 %
0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0025 
0026 function varargout = string(varargin)
0027 
0028   %%% Check if this is a call for parameters
0029   if utils.helper.isinfocall(varargin{:})
0030     varargout{1} = getInfo(varargin{3});
0031     return
0032   end
0033 
0034   %%% Get miir objects
0035   objs = utils.helper.collect_objects(varargin(:), 'miir');
0036 
0037   cmd = '';
0038   for kk = 1:numel(objs)
0039     infile = objs(kk).infile;
0040     if ~isempty(infile)
0041       cmd = [cmd 'miir(''' infile '''), '];
0042     else
0043       pl = objs(kk).hist.plistUsed;
0044       cmd = [cmd 'miir(' string(pl) '), '];
0045     end
0046   end
0047 
0048   cmd = cmd(1:end-2);
0049 
0050   if numel(objs) > 1
0051     cmd = ['[' cmd ']'];
0052   end
0053 
0054   varargout{1} = cmd;
0055 end
0056 
0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0058 %                               Local Functions                               %
0059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0060 
0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0062 %
0063 % FUNCTION:    getInfo
0064 %
0065 % DESCRIPTION: Get Info Object
0066 %
0067 % HISTORY:     11-07-07 M Hewitson
0068 %                Creation.
0069 %
0070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0071 
0072 function ii = getInfo(varargin)
0073   if nargin == 1 && strcmpi(varargin{1}, 'None')
0074     sets = {};
0075     pl   = [];
0076   else
0077     sets = {'Default'};
0078     pl   = getDefaultPlist;
0079   end
0080   % Build info object
0081   ii = minfo(mfilename, 'miir', '', utils.const.categories.output, '$Id: string.m,v 1.9 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0082 end
0083 
0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0085 %
0086 % FUNCTION:    getDefaultPlist
0087 %
0088 % DESCRIPTION: Get Default Plist
0089 %
0090 % HISTORY:     11-07-07 M Hewitson
0091 %                Creation.
0092 %
0093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0094 
0095 function plo = getDefaultPlist()
0096   plo = plist();
0097 end
0098

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