comparison m-toolbox/classes/@ssmblock/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 converts a ssmblock object to a command string which will recreate the object.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: STRING converts a ssmblock object to a command string which will
5 % recreate the ssmblock object.
6 %
7 % CALL: cmd = string(u)
8 %
9 % VERSION: $Id: string.m,v 1.4 2011/02/18 16:48:54 ingo Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 function varargout = string(varargin)
14
15 objs = [varargin{:}];
16
17 pstr = '[ ';
18
19 for ii = 1:numel(objs)
20 pstr = [pstr 'ssmblock('];
21 pstr = [pstr '''' objs(ii).name '''' ',' string(objs(ii).ports) ',' '''' objs(ii).description ''''];
22 pstr = [pstr ''') '];
23
24 end
25
26 pstr = [pstr ']'];
27
28 varargout{1} = pstr;
29 end
30