From: nonyt on
Hello, I am doing a GUI
and i want to display a String on a text box when a button event occur

function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
c={a;b;c;d.....};
d=c(1);
i want to display to text1...

Can anyone help me?
From: Walter Roberson on
nonyt wrote:
> Hello, I am doing a GUI
> and i want to display a String on a text box when a button event occur
> function pushbutton1_Callback(hObject, eventdata, handles)
> % hObject handle to pushbutton1 (see GCBO)
> % eventdata reserved - to be defined in a future version of MATLAB
> % handles structure with handles and user data (see GUIDATA)
> c={a;b;c;d.....};
> d=c(1);
> i want to display to text1...

set(handles.text1, 'String', d)
From: nonyt on
Walter Roberson <roberson(a)hushmail.com> wrote in message <EQaMn.81300$jt.53131(a)newsfe04.iad>...
> nonyt wrote:
> > Hello, I am doing a GUI
> > and i want to display a String on a text box when a button event occur
> > function pushbutton1_Callback(hObject, eventdata, handles)
> > % hObject handle to pushbutton1 (see GCBO)
> > % eventdata reserved - to be defined in a future version of MATLAB
> > % handles structure with handles and user data (see GUIDATA)
> > c={a;b;c;d.....};
> > d=c(1);
> > i want to display to text1...
>
> set(handles.text1, 'String', d)

Thank you very much is working!!!
I have another question...
When i program the GUI I use some variables that i want them to be used when more than one buttons execute where do i have to put the definition of the variables to be public in all the functions of the buttons??
From: Matt Fig on
I assume you are using GUIDE to create your GUI. Have a look at the help for the GUIDATA function.
From: Steven Lord on

"nonyt " <mariaki16(a)hotmail.com> wrote in message
news:htrfrg$ae1$1(a)fred.mathworks.com...
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <EQaMn.81300$jt.53131(a)newsfe04.iad>...
>> nonyt wrote:
>> > Hello, I am doing a GUI
>> > and i want to display a String on a text box when a button event occur
>> > function pushbutton1_Callback(hObject, eventdata, handles)
>> > % hObject handle to pushbutton1 (see GCBO)
>> > % eventdata reserved - to be defined in a future version of MATLAB
>> > % handles structure with handles and user data (see GUIDATA)
>> > c={a;b;c;d.....};
>> > d=c(1);
>> > i want to display to text1...
>>
>> set(handles.text1, 'String', d)
>
> Thank you very much is working!!!
> I have another question...
> When i program the GUI I use some variables that i want them to be used
> when more than one buttons execute where do i have to put the definition
> of the variables to be public in all the functions of the buttons??

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/f5-998197.html

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/f13-998197.html

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com