Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Show results in edit text GUI

Subject: Show results in edit text GUI

From: Samiov

Date: 12 May, 2010 23:44:07

Message: 1 of 14

Hi,
I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?

Subject: Show results in edit text GUI

From: us

Date: 12 May, 2010 23:55:05

Message: 2 of 14

"Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> Hi,
> I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?

one of the solutions

     v=pi;
     uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);

us

Subject: Show results in edit text GUI

From: Samiov

Date: 13 May, 2010 00:54:04

Message: 3 of 14

"us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > Hi,
> > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
>
> one of the solutions
>
> v=pi;
> uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
>
> us
______________________________________________________________________
Hi us,
I found another solution:

set(handles.edit4,'String',X);

Anyway thanks a lot.

Subject: Show results in edit text GUI

From: us

Date: 13 May, 2010 01:39:05

Message: 4 of 14

"Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > Hi,
> > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> >
> > one of the solutions
> >
> > v=pi;
> > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> >
> > us
> ______________________________________________________________________
> Hi us,
> I found another solution:
>
> set(handles.edit4,'String',X);
>
> Anyway thanks a lot.

no, this is the SAME solution...

% we could write
     uh=uicontrol('position',[10,10,100,100],'style','edit');
     v=pi;
     set(uh,'string',v);
% thus, your HANDLES.EDIT4 is simply the equivalent of UH...

us

Subject: Show results in edit text GUI

From: Samiov

Date: 13 May, 2010 02:00:23

Message: 5 of 14

"us " <us@neurol.unizh.ch> wrote in message <hsfl7p$t3$1@fred.mathworks.com>...
> "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> > "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > > Hi,
> > > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> > >
> > > one of the solutions
> > >
> > > v=pi;
> > > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> > >
> > > us
> > ______________________________________________________________________
> > Hi us,
> > I found another solution:
> >
> > set(handles.edit4,'String',X);
> >
> > Anyway thanks a lot.
>
> no, this is the SAME solution...
>
> % we could write
> uh=uicontrol('position',[10,10,100,100],'style','edit');
> v=pi;
> set(uh,'string',v);
> % thus, your HANDLES.EDIT4 is simply the equivalent of UH...
>
> us
______________________________________________________________________
Ah ok, I didn't know that...it's because I'm a beginner, thank you..

Subject: Show results in edit text GUI

From: Nirmal

Date: 14 May, 2010 14:23:21

Message: 6 of 14

"Samiov " <Samyw69@yahoo.fr> wrote in message <hsfmfn$kqk$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <hsfl7p$t3$1@fred.mathworks.com>...
> > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> > > "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > > > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > > > Hi,
> > > > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> > > >
> > > > one of the solutions
> > > >
> > > > v=pi;
> > > > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> > > >
> > > > us
> > > ______________________________________________________________________
> > > Hi us,
> > > I found another solution:
> > >
> > > set(handles.edit4,'String',X);
> > >
> > > Anyway thanks a lot.
> >
> > no, this is the SAME solution...
> >
> > % we could write
> > uh=uicontrol('position',[10,10,100,100],'style','edit');
> > v=pi;
> > set(uh,'string',v);
> > % thus, your HANDLES.EDIT4 is simply the equivalent of UH...
> >
> > us
> ______________________________________________________________________
> Ah ok, I didn't know that...it's because I'm a beginner, thank you..

what if i have to display something in 'edit text' as output??

Subject: Show results in edit text GUI

From: ImageAnalyst

Date: 14 May, 2010 15:33:55

Message: 7 of 14

That's what the set() command does. You're setting the 'string'
property to be your output - whatever text data your want to display.

Subject: Show results in edit text GUI

From: Nirmal

Date: 14 May, 2010 17:22:06

Message: 8 of 14

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5fd43f93-68ba-4311-bbcf-e822e6e00b0b@37g2000yqm.googlegroups.com>...
> That's what the set() command does. You're setting the 'string'
> property to be your output - whatever text data your want to display.

ohkohk got it..thanks

Subject: Show results in edit text GUI

From: Quentin

Date: 4 Jun, 2010 10:35:05

Message: 9 of 14

"Nirmal " <nirmal_2489@yahoo.co.in> wrote in message <hsk0ru$drr$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5fd43f93-68ba-4311-bbcf-e822e6e00b0b@37g2000yqm.googlegroups.com>...
> > That's what the set() command does. You're setting the 'string'
> > property to be your output - whatever text data your want to display.
>
> ohkohk got it..thanks

Hey guys,

just a quick question, in my GUI, I created a Edit Text box, and did the following:

function edit1_Callback(hObject, eventdata, handles)
     v=pi;
     set(handles.edit1,'String',v);

However, I still get the "Edit Text" string in the box...

Could you help me out? thanks!

Subject: Show results in edit text GUI

From: Steven Lord

Date: 4 Jun, 2010 13:24:04

Message: 10 of 14


"Quentin " <quentinbehaghel@hotmail.com> wrote in message
news:huakso$40o$1@fred.mathworks.com...
> "Nirmal " <nirmal_2489@yahoo.co.in> wrote in message
> <hsk0ru$drr$1@fred.mathworks.com>...
>> ImageAnalyst <imageanalyst@mailinator.com> wrote in message
>> <5fd43f93-68ba-4311-bbcf-e822e6e00b0b@37g2000yqm.googlegroups.com>...
>> > That's what the set() command does. You're setting the 'string'
>> > property to be your output - whatever text data your want to display.
>>
>> ohkohk got it..thanks
>
> Hey guys,
>
> just a quick question, in my GUI, I created a Edit Text box, and did the
> following:
>
> function edit1_Callback(hObject, eventdata, handles)
> v=pi;
> set(handles.edit1,'String',v);
>
> However, I still get the "Edit Text" string in the box...
>
> Could you help me out? thanks!

Do you want to display the number pi or the word 'pi' in the edit box?

If the former, set(handles.edit1, 'String', num2str(pi));
If the latter, set(handles.edit1, 'String', 'pi');

If those don't work, make sure that handles.edit1 corresponds to the edit
box you think it does. GET its properties, change its Visible property and
make sure the edit box you expected changes visibility, etc.

--
Steve Lord
slord@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

Subject: Show results in edit text GUI

From: none

Date: 6 Jul, 2012 06:30:08

Message: 11 of 14

"Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > Hi,
> > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> >
> > one of the solutions
> >
> > v=pi;
> > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> >
> > us
> ______________________________________________________________________
> Hi us,
> I found another solution:
>
> set(handles.edit4,'String',X);
>
> Anyway thanks a lot.


what if it is a structure. My output from a gui is a structure with different data types . How to display it . pls help

Subject: Show results in edit text GUI

From: Kristin

Date: 7 Jul, 2012 16:03:07

Message: 12 of 14

"none " <keshav1133@gmail.com> wrote in message <jt60lg$l6a$1@newscl01ah.mathworks.com>...
> "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> > "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > > Hi,
> > > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> > >
> > > one of the solutions
> > >
> > > v=pi;
> > > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> > >
> > > us
> > ______________________________________________________________________
> > Hi us,
> > I found another solution:
> >
> > set(handles.edit4,'String',X);
> >
> > Anyway thanks a lot.
>
>
> what if it is a structure. My output from a gui is a structure with different data types . How to display it . pls help

Do you mean display the structure fields or display the field contents?

Subject: Show results in edit text GUI

From: none

Date: 7 Jul, 2012 18:37:10

Message: 13 of 14

"Kristin" wrote in message <jt9mjr$jav$1@newscl01ah.mathworks.com>...
> "none " <keshav1133@gmail.com> wrote in message <jt60lg$l6a$1@newscl01ah.mathworks.com>...
> > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfijc$avp$1@fred.mathworks.com>...
> > > "us " <us@neurol.unizh.ch> wrote in message <hsff4p$13f$1@fred.mathworks.com>...
> > > > "Samiov " <Samyw69@yahoo.fr> wrote in message <hsfeg7$jhm$1@fred.mathworks.com>...
> > > > > Hi,
> > > > > I've obtained a numerical result saved in a variable X and I want to know how to display it in an edit text in my GUI?
> > > >
> > > > one of the solutions
> > > >
> > > > v=pi;
> > > > uh=uicontrol('position',[10,10,100,100],'style','edit','string',v);
> > > >
> > > > us
> > > ______________________________________________________________________
> > > Hi us,
> > > I found another solution:
> > >
> > > set(handles.edit4,'String',X);
> > >
> > > Anyway thanks a lot.
> >
> >
> > what if it is a structure. My output from a gui is a structure with different data types . How to display it . pls help
>
> Do you mean display the structure fields or display the field contents?

i want to get the result as we get when we display any structure in command window ... that is the feild and then the values ....

Subject: Show results in edit text GUI

From: Kristin

Date: 7 Dec, 2012 21:49:10

Message: 14 of 14

> > Do you mean display the structure fields or display the field contents?
>
> i want to get the result as we get when we display any structure in command window ... that is the feild and then the values ....

Sorry for the late reply... see function FIELDNAMES.
Displaying the size and/or value of each field should follow easily..

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us