comparison m-toolbox/classes/@ssmblock/getPortsAtIndices.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 % GETPORTSATINDICES get all ports at the given indices.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: GETPORTSATINDICES get all ports at the given indices.
5 %
6 % CALL: ports = getPort(ssmblocks, indices)
7 % ports = getPort(ssmblocks, plist('indices', someIndices))
8 %
9 % VERSION: $Id: getPortsAtIndices.m,v 1.5 2011/02/18 16:48:54 ingo Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 function varargout = getPortsAtIndices(varargin)
13 error('This function is deprecated and will be deleted')
14
15 [objs, in_vars, rest] = utils.helper.collect_objects(varargin(:), 'ssmblock');
16 [pl, in_vars, rest] = utils.helper.collect_objects(rest, 'plist');
17
18 ports = [];
19 indices = [];
20
21 if isa(pl, 'plist')
22 indices = pl.find('indices');
23 end
24 for kk=1:numel(rest)
25 if isnumeric(rest{kk})
26 indices = rest{kk};
27 end
28 end
29
30 for kk=1:numel(objs)
31 ports = [ports objs(kk).ports(indices(indices<=numel(objs(kk).ports)))];
32 end
33
34 varargout{1} = ports;
35
36 end