view m-toolbox/classes/@time/string.m @ 51:9d5c88356247 database-connection-manager

Make unit tests database connection parameters configurable
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:24:37 +0100
parents f0afece42f48
children
line wrap: on
line source

% STRING writes a command string that can be used to recreate the input time object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: STRING writes a command string that can be used to recreate the
%              input time object.
%
% CALL:        cmd = string(time-object);
%
% VERSION:     $Id: string.m,v 1.13 2011/02/18 16:48:55 ingo Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function cmd = string(varargin)

  % collect the time-objects
  tt = [varargin{:}];

  cmd = '';
  for jj=1:length(tt)
    pl = plist('milliseconds', tt(jj).utc_epoch_milli);
    cmd = [cmd 'time(' string(pl) ') '];
  end

  % if the there are more than one object wrap the command with brackets 
  if numel(tt) > 1
    cmd = ['[' cmd(1:end-1) ']'];
  end

end