Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: reading input from a GUI

Subject: reading input from a GUI

From: Thiago Jota

Date: 04 Feb, 2008 02:36:01

Message: 1 of 3

Folks,

Simple question. I'm avoiding "inputdlg" in order to
customize my GUI, but I need something similar. How can I
store what I enter in a text field?

Subject: Re: reading input from a GUI

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 04 Feb, 2008 04:56:44

Message: 2 of 3

In article <fo5tmh$h2s$1@fred.mathworks.com>,
Thiago Jota <thiago@mathworks.com> wrote:

>Simple question. I'm avoiding "inputdlg" in order to
>customize my GUI, but I need something similar. How can I
>store what I enter in a text field?

If you mean "store into a variable that which is already
in a text field", then the answer is that you get() the 'String'
property of the text field handle. The result will be a string.
If you need the numeric equivilent of a number represented
by the string, then after validating that the string looks like
a number, you can call str2num or str2double or sscanf .

If you mean "Put a value into a text field", then the answer
is that you set() the 'String' property of the text field with
a string. If your existing value is a number, then you can
form a string representation of the number by calling num2str
or sprintf.
--
   "Beware of bugs in the above code; I have only proved it correct,
   not tried it." -- Donald Knuth

Subject: reading input from a GUI

From: Vihang Patil

Date: 04 Feb, 2008 05:20:02

Message: 3 of 3

"Thiago Jota" <thiago@mathworks.com> wrote in message
<fo5tmh$h2s$1@fred.mathworks.com>...
> Folks,
>
> Simple question. I'm avoiding "inputdlg" in order to
> customize my GUI, but I need something similar. How can I
> store what I enter in a text field?

Hello
There is a simple gui program on the File Central
(http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18212&objectType=file)
You can modify it according to your requirement to send
output to the workspace. Instead of a radio button make a
edit box and get the value from the get() .
HTH
Vihang

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics