comparison m-toolbox/classes/@time/string.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % STRING writes a command string that can be used to recreate the input time object.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: STRING writes a command string that can be used to recreate the
5 % input time object.
6 %
7 % CALL: cmd = string(time-object);
8 %
9 % VERSION: $Id: string.m,v 1.13 2011/02/18 16:48:55 ingo Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 function cmd = string(varargin)
14
15 % collect the time-objects
16 tt = [varargin{:}];
17
18 cmd = '';
19 for jj=1:length(tt)
20 pl = plist('milliseconds', tt(jj).utc_epoch_milli);
21 cmd = [cmd 'time(' string(pl) ') '];
22 end
23
24 % if the there are more than one object wrap the command with brackets
25 if numel(tt) > 1
26 cmd = ['[' cmd(1:end-1) ']'];
27 end
28
29 end
30