checkbox1's callback for date and time:
m=1;
while m==1
m=get(hObject,'value');
txt=datestr(now);
set(handles.datetime,'string',txt);
pause(1);
end
can you please help me to remove the checkbox that if I will push the RUN button the datetime static text will automatically call the date and time.

댓글 수: 5

Jan
Jan 2013년 10월 8일
I do not understand the question. Which checkbox do you want to remove? Does "remove" mean deleting in the GUI, unchecking in the GUI or removing the code from the FIG file or the Matlab code? There is no "RUN" button in teh shown code. What does "call the date and time" mean?
A TIMER is much smarter than a blocking loop, when you want to update a clock display.
Lloyd
Lloyd 2013년 10월 8일
I want to remove the checkbox1 and the RUN button that I mean is the compile button which builds up the code to make it work. Calling the date and time on a figure file and it will appear in the GUI at a static text. would you mind suggesting a better timer code?
Jan
Jan 2013년 10월 8일
I do not know a "compile button". What do you mean by "figure file"?
I do not understand any sentence currently.
Lloyd
Lloyd 2013년 10월 8일
ok, I have this licenseplate.fig and whenever I will open it in guide, there's a green triangle play button. If i will push it, the gui appears and I want the date and time appears as soon as I push it.
Walter Roberson
Walter Roberson 2013년 10월 8일
I think GUIDE is being referred to. And that Lloyd wants the time display to start going as soon as the GUI is launched instead of only after a button is clicked.

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

 채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 8일

0 개 추천

Create a timer() object to do the updating.

댓글 수: 1

Lloyd
Lloyd 2013년 10월 8일
It'll be my first time to do a timer. I'm still learning matlab so please enlighten me :)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2013년 10월 8일

댓글:

2013년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by