Path: news.mathworks.com!not-for-mail
From: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Load data from workspace to gui
Date: Tue, 30 Jun 2009 20:21:01 +0000 (UTC)
Organization: Citizens Bank
Lines: 16
Message-ID: <h2ds3d$9f6$1@fred.mathworks.com>
References: <h2di6h$8ca$1@fred.mathworks.com>
Reply-To: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246393261 9702 172.30.248.38 (30 Jun 2009 20:21:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 30 Jun 2009 20:21:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 918333
Xref: news.mathworks.com comp.soft-sys.matlab:551819


Let 'var' contain the name of the variable you want to be displayed and 'boxHndl' contain handle to the edit box where you want variable to appear

In the Callback to the button do the following:

% create box handle variable in the base workspace
assignin('base', 'dispBoxHndl, boxHndl)

% assign variable value to the box
evalin('base', ['set(boxHndl, ''String'', num2str(' var '))'])

"Eli Chmouni" <echmouni@gmail.com> wrote in message <h2di6h$8ca$1@fred.mathworks.com>...
> Hello everyone;
> i have created a gui that loads a .mat file and thus save all the variables in the matlab workspace. My second task now is i have 2 edit text boxes and a push button 
> --->what i want to happen is the user of the gui can enter the name of a variable already existing in the workspace and then click the push button and the value of the variable should appear in the second edit text box (that could be a static text box too)
> any help would be appreciated
> Thank you