Home > classes > @timespan > char.m

char

PURPOSE ^

CHAR convert a timespan object into a string.

SYNOPSIS ^

function pstr = char(ts ,varargin)

DESCRIPTION ^

 CHAR convert a timespan object into a string.

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

 DESCRIPTION: CHAR convert a timespan object into a string.

 CALL:        string = char(timespan)

 VERSION:     $Id: char.html,v 1.12 2008/03/31 10:27:39 hewitson Exp $

 HISTORY:     23-07-2007 Diepholz
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function pstr = char(ts ,varargin)
0002 % CHAR convert a timespan object into a string.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: CHAR convert a timespan object into a string.
0007 %
0008 % CALL:        string = char(timespan)
0009 %
0010 % VERSION:     $Id: char.html,v 1.12 2008/03/31 10:27:39 hewitson Exp $
0011 %
0012 % HISTORY:     23-07-2007 Diepholz
0013 %                 Creation
0014 %
0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0016 
0017 VERSION  = '$Id: char.html,v 1.12 2008/03/31 10:27:39 hewitson Exp $';
0018 CATEGORY = 'Output';
0019 
0020 % Check if this is a call for parameters
0021 if nargin == 2
0022   if isa(ts, 'timespan') && ischar(varargin{1})
0023     in = char(varargin{1});
0024     if strcmp(in, 'Params')
0025       pstr = plist;
0026       return
0027     elseif strcmp(in, 'Version')
0028       pstr = VERSION;
0029       return
0030     elseif strcmp(in, 'Category')
0031       pstr = CATEGORY;
0032       return
0033     end
0034   end
0035 end
0036 
0037 pstr = ['start: ' char(ts.start) ' end: ' char(ts.end)];
0038 
0039 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003