You can use the EVALIN function in your GUI to get the value of a variable from the base workspace. The following example retrieves the value of a variable Ain the base workspace and places this value in a local variable B:
B = evalin('base','A');
, , , . GUI :
varName = get(hEditText,'String'); %
%
try %
varValue = evalin('base',varName); %
catch exception %
error(['Variable ''' varName ... %
''' doesn''t exist in workspace.']);
end