comparison m-toolbox/classes/+utils/@prog/gcbsh.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 function varargout = gcbsh()
2
3 % GCBSH gets the handles for the currently selected blocks.
4 %
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 %
7 % GCBSH gets the handles for the currently selected blocks.
8 %
9 % Usage: >> gcbsh
10 % >> h = gcbsh
11 %
12 % M Hewitson 29-08-07
13 %
14 % $Id: gcbsh.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $
15 %
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
18 h = [];
19
20 blks = find_system(gcs, 'SearchDepth',1, 'LookUnderMasks', 'all', 'Type', 'block');
21 hs = get_param(blks, 'Handle');
22
23 % get selected blocks
24 for j=1:length(hs)
25 if get_param(gcs, 'Handle') ~= hs{j}
26 if strcmp(get(hs{j}, 'Selected'), 'on')
27 h = [h hs{j}];
28 end
29 end
30 end
31
32 if nargout == 0
33 disp(h.')
34 elseif nargout == 1
35 varargout{1} = h.';
36 else
37 error('### Too many output arguments')
38 end