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: Thu, 30 Jul 2009 13:33:03 +0000 (UTC)
Organization: Citizens Bank
Lines: 36
Message-ID: <h4s7ef$ahh$1@fred.mathworks.com>
References: <h2di6h$8ca$1@fred.mathworks.com> <h2ds3d$9f6$1@fred.mathworks.com> <h4rih1$a0u$1@fred.mathworks.com>
Reply-To: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
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 1248960783 10801 172.30.248.37 (30 Jul 2009 13:33:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 30 Jul 2009 13:33:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 918333
Xref: news.mathworks.com comp.soft-sys.matlab:559621


It looks like I've made a mistake.  The code should've been

assignin('base', 'dispBoxHndl', boxHndl)
evalin('base', ['set(dispBoxHndl, ''String'', num2str(' var '))'])

So in your case it should be like this

 assignin('base', 'dispedit13', handles.edit13)
 evalin('base', ['set(dispedit13, ''String'', num2str(' var '))'])


"Giacomo " <bigbig1982@hotmail.com> wrote in message <h4rih1$a0u$1@fred.mathworks.com>...
> "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