view m-toolbox/classes/@provenance/string.m @ 4:e3c5468b1bfe
database-connection-manager
Integrate with LTPDAPreferences
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − % STRING writes a command string that can be used to recreate the input provenance object.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: STRING writes a command string that can be used to recreate the
+ − % input provenance object.
+ − %
+ − % CALL: cmd = string(obj)
+ − %
+ − % INPUT: obj - provenance object
+ − %
+ − % OUTPUT: cmd - command string to create the input object
+ − %
+ − % VERSION: $Id: string.m,v 1.8 2011/02/18 16:48:54 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function cmd = string(varargin)
+ −
+ − objs = [varargin{:}];
+ −
+ − %%% Wrap the command only in bracket if the there are more than one object
+ − if length(objs) > 1
+ − cmd = '[';
+ − else
+ − cmd = '';
+ − end
+ −
+ − for j=1:length(objs)
+ − creator = objs(j).creator;
+ − cmd = [cmd 'provenance(''' creator ''') '];
+ − end
+ −
+ − if length(objs) > 1
+ − cmd = [cmd ']'];
+ − end
+ − end
+ −