Mercurial > hg > ltpda
diff m-toolbox/classes/@sigBuilder/cb_buildExport.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@sigBuilder/cb_buildExport.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,33 @@ +% cb_buildExport fires when the user clicks 'build & export' +% +% M Hewitson +% +% $Id: cb_buildExport.m,v 1.2 2011/04/08 08:56:35 hewitson Exp $ +% +function cb_buildExport(varargin) + + myh = varargin{1}; + mainfig = varargin{end}; + + % Build signal + obj = sigBuilder.buildSignal(mainfig); + + % check current workspace variables + basename = 'ex_obj'; + ex = 0; + n = []; + vars = evalin('base', 'who'); + for j=1:length(vars) + v = char(vars{j}); + if strncmp(basename, v, length(basename)) == 1 + % get the number + n = [n str2num(v(end-1:end))]; + end + end + + % Loop over selected objects + ex = max([n ex])+1; + varname = sprintf('%s_%02d', basename, ex); + assignin('base', varname, obj); + +end