I'd like to make a timer or stopwatch
조회 수: 9 (최근 30일)
이전 댓글 표시
I'm making a clock that as some functions, a time zone based clock, and i would like it to have a "timer" function to! Can someone help me? I'm novice so i don't know much of matlab but any help would be appreciated!
[Merged from duplicate question]
I need to make a timer where in a menu i choose the option " Start " the function timer starts running and when the user chooses the option " Stop " the timer stops and shows the user the time that have passed. I'm using the choice = menu ( 'title' , 'option1' , ... ) menu, and i made something like Choice = menu ( ' Timer ', ' Start ' ) and when the user pressed start i wanted the timer to start running and another menu would appear with the ' stop ' option , and when the user pressed the stop button, Matlab would show the time that as passed
댓글 수: 0
채택된 답변
Daniel LaCroix
2016년 1월 4일
Making a GUI for the timer could be tricky, but the actual timer part would be simple. When the timer should start, call the tic command. When the timer should stop, call toc and the elapsed time will be shown. You can call toc as many times as you want, and it will show the time since tic. Reset the timer by calling tic again.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!