Home > classes > @ssm > char.m

char

PURPOSE ^

CHAR convert a ssm object into a string.

SYNOPSIS ^

function varargout = char(varargin)

DESCRIPTION ^

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

 DESCRIPTION: CHAR convert a ssm object into a string.

 CALL:        string = char(ssm)

 MFILE INFO: Get information about this methods by calling
              >> ssm.getInfo('char')

              Get information about a specified setplist by calling:
              >> ssm.getInfo('char', 'set')

 VERSION:     $Id: char.m,v 1.9 2008/07/21 13:57:30 ingo Exp $

 HISTORY:     04022007 M Hewitson
                 Creation

 TODO :       make it work with symbolic (wait for symb. toolbox in R2008b'?)

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CHAR convert a ssm object into a string.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CHAR convert a ssm object into a string.
0005 %
0006 % CALL:        string = char(ssm)
0007 %
0008 % MFILE INFO: Get information about this methods by calling
0009 %              >> ssm.getInfo('char')
0010 %
0011 %              Get information about a specified setplist by calling:
0012 %              >> ssm.getInfo('char', 'set')
0013 %
0014 % VERSION:     $Id: char.m,v 1.9 2008/07/21 13:57:30 ingo Exp $
0015 %
0016 % HISTORY:     04022007 M Hewitson
0017 %                 Creation
0018 %
0019 % TODO :       make it work with symbolic (wait for symb. toolbox in R2008b'?)
0020 %
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 
0023 function varargout = char(varargin)
0024 
0025   %%% Check if this is a call for parameters
0026   if utils.helper.isinfocall(varargin{:})
0027     varargout{1} = getInfo(varargin{3});
0028     return
0029   end
0030 
0031   objs = utils.helper.collect_objects(varargin(:), 'ssm');
0032 
0033   pstr = '';
0034 
0035   for ii = 1:numel(objs)
0036     obj = objs(ii);
0037     pstr = [pstr sprintf('ssm(name=%s), ', obj.name)];
0038   end
0039 
0040   pstr = strrep(pstr, '_', '\_');
0041   pstr = pstr(1:end-2);
0042 
0043   varargout{1} = pstr;
0044 end
0045 
0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0047 %                               Local Functions                               %
0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0049 
0050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0051 %
0052 % FUNCTION:    getInfo
0053 %
0054 % DESCRIPTION: Get Info Object
0055 %
0056 % HISTORY:     110707 M Hewitson
0057 %                Creation.
0058 %
0059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0060 
0061 function ii = getInfo(varargin)
0062   if nargin == 1 && strcmpi(varargin{1}, 'None')
0063     sets = {};
0064     pl   = [];
0065   else
0066     sets = {'Default'};
0067     pl   = getDefaultPlist;
0068   end
0069   % Build info object
0070   ii = minfo(mfilename, 'ssm', '', 'Output', '$Id: char.m,v 1.9 2008/07/21 13:57:30 ingo Exp $', sets, pl);
0071 end
0072 
0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0074 %
0075 % FUNCTION:    getDefaultPlist
0076 %
0077 % DESCRIPTION: Get Default Plist
0078 %
0079 % HISTORY:     110707 M Hewitson
0080 %                Creation.
0081 %
0082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0083 
0084 function plo = getDefaultPlist()
0085   plo = plist();
0086 end
0087 
0088

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