calculate the time between 2 click
조회 수: 5 (최근 30일)
이전 댓글 표시
hi how can i measure the time between 2 click in Matlab?(ex: 1er click(or key) start the timer, the second click(key) stop the timer) thanks
댓글 수: 0
답변 (1개)
Jan
2016년 4월 16일
편집: Jan
2016년 4월 16일
function TestGUI
FigH = figure('WindowButtonDownFcn', @myClick, ... % Mouse click
'WindowKeyPressFcn', @myClick); % Key press
handles.running = false;
handles.time = 0;
guidata(FigH, handles);
end
function myClick(hObject, EventData)
handles = guidata(hObject);
if handles.running % Display the time between clicks:
disp(etime(clock, handles.time));
handles.running = false;
else % Start the timer:
handles.running = true;
handles.time = clock;
end
guidata(hObject, handles);
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!