Home > classes > @mfir > 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(mfir)

 INPUTS:      cmd  - IIR filter object

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

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

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

 VERSION:     $Id: string.m,v 1.8 2008/09/04 15:29:30 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(mfir)
0008 %
0009 % INPUTS:      cmd  - IIR filter object
0010 %
0011 % OUTPUTS:     mfir - command string to create the IIR filter object
0012 %
0013 % M-FILE INFO: Get information about this methods by calling
0014 %              >> mfir.getInfo('string')
0015 %
0016 %              Get information about a specified set-plist by calling:
0017 %              >> mfir.getInfo('string', 'None')
0018 %
0019 % VERSION:     $Id: string.m,v 1.8 2008/09/04 15:29:30 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   objs = utils.helper.collect_objects(varargin(:), 'mfir');
0035 
0036   cmd = '';
0037   for kk = 1:numel(objs)
0038     infile = objs(kk).infile;
0039     if ~isempty(infile)
0040       cmd = [cmd 'mfir(''' infile '''), '];
0041     else
0042       pl = objs(kk).hist.plistUsed;
0043       cmd = [cmd 'mfir(' string(pl) '), '];
0044     end
0045   end
0046 
0047   cmd = cmd(1:end-2);
0048 
0049   if numel(objs) > 1
0050     cmd = ['[' cmd ']'];
0051   end
0052 
0053   varargout{1} = cmd;
0054 end
0055 
0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0057 %                               Local Functions                               %
0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0059 
0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061 %
0062 % FUNCTION:    getInfo
0063 %
0064 % DESCRIPTION: Get Info Object
0065 %
0066 % HISTORY:     11-07-07 M Hewitson
0067 %                Creation.
0068 %
0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0070 
0071 function ii = getInfo(varargin)
0072   if nargin == 1 && strcmpi(varargin{1}, 'None')
0073     sets = {};
0074     pl   = [];
0075   else
0076     sets = {'Default'};
0077     pl   = getDefaultPlist;
0078   end
0079   % Build info object
0080   ii = minfo(mfilename, 'mfir', '', utils.const.categories.output, '$Id: string.m,v 1.8 2008/09/04 15:29:30 ingo Exp $', sets, pl);
0081 end
0082 
0083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0084 %
0085 % FUNCTION:    getDefaultPlist
0086 %
0087 % DESCRIPTION: Get Default Plist
0088 %
0089 % HISTORY:     11-07-07 M Hewitson
0090 %                Creation.
0091 %
0092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0093 
0094 function plo = getDefaultPlist()
0095   plo = plist();
0096 end
0097

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