Effacer les filtres
Effacer les filtres

How do I get my string from a handle.text GUI HELP

2 vues (au cours des 30 derniers jours)
Amed
Amed le 11 Fév 2013
I'm trying to obtain a string value and set it as a variable 'a' ..
So in the opening function I set a particular handles.text to 'TRUE'. One pushbutton sets handle.text to 'FALSE', but I want to be able to read if that value is true or false to stop a loop.
I tried to set them as integers, but Matlab didn't allow me to? For example
set(handles.text, 'String', 'TRUE')
works fine.. but if I try
set(handles.text, 'double', 0)
i'm told it's an invalid property.. is there a property for integers? if not can I read out my text as a separate variable 'a'?

Réponse acceptée

Image Analyst
Image Analyst le 11 Fév 2013
No there is no "double" property for text label controls. Perhaps you want to use the UserData property to store things.
  7 commentaires
Amed
Amed le 11 Fév 2013
i'm trying to set text as some sort of string data, and then compare it in an if statement.. if that text handle is true, do this, if false, do that. but I cannot get the data from the text handle.
Amed
Amed le 11 Fév 2013
THANKS SOLVED!

Connectez-vous pour commenter.

Plus de réponses (1)

ChristianW
ChristianW le 11 Fév 2013
Get String from text handle:
get(handles.text,'String')
Checking and breaking a loop:
if strcmp(get(handles.text,'String'),'FALSE')
return
end

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by