GUI edit text box values not getting updated
Mostrar comentarios más antiguos
Hi friends i am working with matlab gui. Problem is string values are not getting updated. please check the sample code below
if true
function pushbutton_Callback(hObject, eventdata, handles)
if strcmp(get(handles.pushbutton,'String'),'START')
set(handles.pushbutton,'String','STOP')
%some code
while(strcmp(get(handles.pushbutton,'String'),'STOP'))
disp('Entered while loop')
%some code
Input1=sscanf(InputTemp, '%d')
set(handles.Textbox1, 'String', Input1)
end
[ Control ] = Controller( Input1 ) %function that will give control signal %depending on input temperature
if(Control=='0001')
set(handles.Textbox2, 'String','some text' )
else
set(handles.Textbox2, 'String','some text1' )
end
%some code
end
else
set(handles.pushbutton,'String','START')
end
end
If i hit 'pushbutton' string "start" should be changed to "stop" but that is not happening. But if that is the case process should not enter while loop. But it is entering while loop and running every thing inside continuously as required(receiving values and sending desired values through serial port). Only problem i am getting in while loop is both edit text boxes 'Textbox1' and 'Textbox2' are not displaying required values. If i am terminating the process(Ctrl+C) then the final value of temperature and control strings are getting displayed. I am unable to find any error with the code. Please help me out with this.
Thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Identification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!