comparison m-toolbox/classes/@provenance/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 provenance object.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: STRING writes a command string that can be used to recreate the
5 % input provenance object.
6 %
7 % CALL: cmd = string(obj)
8 %
9 % INPUT: obj - provenance object
10 %
11 % OUTPUT: cmd - command string to create the input object
12 %
13 % VERSION: $Id: string.m,v 1.8 2011/02/18 16:48:54 ingo Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function cmd = string(varargin)
18
19 objs = [varargin{:}];
20
21 %%% Wrap the command only in bracket if the there are more than one object
22 if length(objs) > 1
23 cmd = '[';
24 else
25 cmd = '';
26 end
27
28 for j=1:length(objs)
29 creator = objs(j).creator;
30 cmd = [cmd 'provenance(''' creator ''') '];
31 end
32
33 if length(objs) > 1
34 cmd = [cmd ']'];
35 end
36 end
37