|
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
|