view m-toolbox/classes/@time/string.m @ 17:7afc99ec5f04 database-connection-manager

Update ao_model_retrieve_in_timespan
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +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