Home > classes > @cdata > char.m

char

PURPOSE ^

CHAR convert a cdata-object into a string.

SYNOPSIS ^

function varargout = char(varargin)

DESCRIPTION ^

 CHAR convert a cdata-object into a string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CHAR convert a cdata object into a string.

 CALL:        string = char(fsdata)

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

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

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

 HISTORY:     23-07-2007 Diepholz
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CHAR convert a cdata-object into a string.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CHAR convert a cdata object into a string.
0005 %
0006 % CALL:        string = char(fsdata)
0007 %
0008 % M-FILE INFO: Get information about this methods by calling
0009 %              >> fsdata.getInfo('char')
0010 %
0011 %              Get information about a specified set-plist by calling:
0012 %              >> fsdata.getInfo('char', 'set')
0013 %
0014 % VERSION:     $Id: char.m,v 1.9 2008/09/04 15:29:30 ingo Exp $
0015 %
0016 % HISTORY:     23-07-2007 Diepholz
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   % Collect all cdata-objects
0030   objs = utils.helper.collect_objects(varargin(:), '');
0031 
0032   
0033   %%% Add the size of the data (all)
0034   pstr = sprintf('(Ndata=[%sx%s],', num2str(size(objs.y,1)), num2str(size(objs.y,2)));
0035 
0036   %%% Add the sample rate of data (tsdata, fsdata)
0037   if isprop(objs, 'fs')
0038     pstr = sprintf('%s fs=%g,', pstr, objs.fs);
0039   end
0040 
0041   %%% Add the length of this time-series in seconds (tsdata)
0042   if isprop(objs, 'nsecs')
0043     pstr = sprintf('%s nsecs=%d,', pstr, objs.nsecs);
0044   end
0045 
0046   %%% Add number of averages (fsdata)
0047   if isprop(objs, 'navs')
0048     pstr = sprintf('%s navs=%d,', pstr, objs.navs);
0049   end
0050 
0051   %%% Add time-stamp of the first data sample (fsdata, tsdata)
0052   if isprop(objs, 't0')
0053     pstr = sprintf('%s t0=%s,', pstr, char(objs.t0));
0054   end
0055 
0056   pstr(end) = ')';
0057   
0058   varargout{1} = pstr;
0059 end
0060 
0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0062 %                               Local Functions                               %
0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0064 
0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0066 %
0067 % FUNCTION:    getInfo
0068 %
0069 % DESCRIPTION: Get Info Object
0070 %
0071 % HISTORY:     11-07-07 M Hewitson
0072 %                Creation.
0073 %
0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0075 
0076 function ii = getInfo(varargin)
0077   if nargin == 1 && strcmpi(varargin{1}, 'None')
0078     sets = {};
0079     pl   = [];
0080   else
0081     sets = {'Default'};
0082     pl   = getDefaultPlist;
0083   end
0084   % Build info object
0085   ii = minfo(mfilename, 'cdata', '', utils.const.categories.internal, '$Id: char.m,v 1.9 2008/09/04 15:29:30 ingo Exp $', sets, pl);
0086 end
0087 
0088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0089 %
0090 % FUNCTION:    getDefaultPlist
0091 %
0092 % DESCRIPTION: Get Default Plist
0093 %
0094 % HISTORY:     11-07-07 M Hewitson
0095 %                Creation.
0096 %
0097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0098 
0099 function plo = getDefaultPlist()
0100   plo = plist();
0101 end
0102

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