Set Edit Text Empty

조회 수: 3 (최근 30일)
Moh
Moh 2014년 12월 7일
댓글: Jan 2014년 12월 7일
I am programming GUI. In this GUI I have two edit text and a button. when I print to the button shows the result at the end of the invoice to the two edit text. the invoice period 2 to 3 minute. I want every time I print on Button set both Edit Text Empty and after the end of the statement shows the result in Edit Text I have the code written but set both Edit Text Empty does not work
function rechnen_button_Callback(hObject, eventdata, handles)
set(handles.D_edit,'String','');
set(handles.P_end_edit,'String','');
here is the rest code
set(handles.D_edit,'String',D*1e3);
set(handles.P_end_edit,'String',p_(1));

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 12월 7일
편집: Azzi Abdelmalek 2014년 12월 7일
set(handles.D_edit,'String',num2str(D*1e3));
set(handles.P_end_edit,'String',num2str(p_(1)));
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2014년 12월 7일
Maybe you need to use the pause command to see the result
set(handles.D_edit,'String','');
set(handles.P_end_edit,'String','');
pause(3)
Jan
Jan 2014년 12월 7일
pause(3)? Why do you assume that waiting 3 seconds is useful?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Moh
Moh 2014년 12월 7일
편집: Moh 2014년 12월 7일
that worked fine I have another solution with "drawnow"
set(handles.D_edit,'String','');
set(handles.P_end_edit,'String','');
drawnow;
thanks

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by