If statement involving GUI criterias
Mostra commenti meno recenti
Hello everyone,
I am building a GUI and I am not able to execute a case in the execution.
I have an uipanel in which there is a radiobutton and a popupmenu( those 2 button are linked somehow). When clicking on the radiobutton I am able to select 3 options in the popupmenu, where there are 3 strings( X-ALL, X - GOODS, X- SERVICES) in my popupmenu.
so i wrote a get eventdata, to get the tags of each radiobutton then I used the switch in order to differentiate between the cases
the radiobutton connected to the popupmenu has a value of 1.
so my IF statement is
if get(handles.radiobutton4,'Value') == 1 & strcmp('X - All', get(handles.popupmenu1,'String'))
msgbox('test')
else
msgbox('KO')
end
I am getting KO.
I know there is an issue on this part of the statement strcmp('X - All', get(handles.popupmenu1,'String'))
because this gives an array as follows :
1 0 0
so my question is how to make the the statement take only the first element of the 'String Array' and compare it with the value of radiobutton...
Itried str2num but it didnt work...
Thank you very much
D
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Legend in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!