Home > m > helper > gcbsh.m

gcbsh

PURPOSE ^

GCBSH gets the handles for the currently selected blocks.

SYNOPSIS ^

function varargout = gcbsh()

DESCRIPTION ^

 GCBSH gets the handles for the currently selected blocks.
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 GCBSH gets the handles for the currently selected blocks.
 
 Usage: >> gcbsh
        >> h = gcbsh
 
 M Hewitson 29-08-07
 
 $Id:$
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = gcbsh()
0002 
0003 % GCBSH gets the handles for the currently selected blocks.
0004 %
0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0006 %
0007 % GCBSH gets the handles for the currently selected blocks.
0008 %
0009 % Usage: >> gcbsh
0010 %        >> h = gcbsh
0011 %
0012 % M Hewitson 29-08-07
0013 %
0014 % $Id:$
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 h = [];
0019 
0020 blks = find_system(gcs, 'Type', 'block');
0021 hs   = get_param(blks, 'Handle');
0022 
0023 % get selected blocks
0024 for j=1:length(hs)
0025   if strcmp(get(hs{j}, 'Selected'), 'on')
0026     h = [h hs{j}];
0027   end
0028 end
0029 
0030 if nargout == 0
0031   disp(h.')
0032 elseif nargout == 1
0033   varargout{1} = h.';
0034 else
0035   error('### Too many output arguments')
0036 end

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003