Home > m > gui > constructor_helper > ltpda_constructor_helper_build.m

ltpda_constructor_helper_build

PURPOSE ^

Callback for the build constructor gui

SYNOPSIS ^

function ltpda_constructor_helper_build(varargin)

DESCRIPTION ^

 Callback for the build constructor gui

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ltpda_constructor_helper_build(varargin)
0002 % Callback for the build constructor gui
0003 
0004 mainfig = findobj('Tag', 'LTPDAconstructor_helper');
0005 
0006 % get object name
0007 varh = findobj(mainfig, 'Tag', 'LTPDA_constructor_helper_var');
0008 varname = get(varh, 'String');
0009 
0010 % get selected class
0011 clh   = findobj(mainfig, 'Tag', 'LTPDA_constructor_helper_class');
0012 cltxt = get(clh, 'String');
0013 cl    = cltxt{get(clh, 'Value')};
0014 
0015 % get base workspace variables
0016 ws_vars = evalin('base','who');
0017 
0018 % check if this one is there or not
0019 if ismember(varname, ws_vars)
0020   j = 1;
0021   vname = varname;
0022   while ismember(vname, ws_vars)
0023     vname = sprintf('%s_%03d', varname, j);
0024     j = j + 1;
0025   end
0026 else
0027   vname = varname;
0028 end
0029 
0030 disp(sprintf('** exporting to %s', vname));
0031 
0032 % Get constructor string
0033 ch   = findobj(mainfig, 'Tag', 'LTPDA_constructor_helper_constructor');
0034 cstr = get(ch, 'String');
0035 
0036 cmd = sprintf('%s = %s;', vname, cstr);
0037 evalin('base', cmd);
0038 
0039 
0040 
0041 
0042

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003