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