Path: news.mathworks.com!not-for-mail
From: "Giacomo " <bigbig1982@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Load data from workspace to gui
Date: Thu, 30 Jul 2009 07:36:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <h4rih1$a0u$1@fred.mathworks.com>
References: <h2di6h$8ca$1@fred.mathworks.com> <h2ds3d$9f6$1@fred.mathworks.com>
Reply-To: "Giacomo " <bigbig1982@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248939361 10270 172.30.248.37 (30 Jul 2009 07:36:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 30 Jul 2009 07:36:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1880541
Xref: news.mathworks.com comp.soft-sys.matlab:559528


"Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu> wrote in message <h2ds3d$9f6$1@fred.mathworks.com>...
> 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 


Hi Ilya, so if the edit text cell where I want the variable to appear is called for example "edit13" the code on the button for display will be:
assignin('base', 'dispedit13', handles.edit13)
evalin('base', ['set(handles.edit13, ''String'', num2str(' var '))'])

Correct? Thank you