ALARM

버전 1.0.0.1 (4.02 KB) 작성자: Jiro Doke
An alarm function that displays a dialog box after a set length of time.
다운로드 수: 4.3K
업데이트 날짜: 2016/9/1

라이선스 보기

ALARM Displays an alarm message after a set time.
ALARM(T, MSG) displays a message after T seconds with a text message MSG. After T seconds, the computer will start beeping and display a dialog box with an option to Snooze. The beeping will stop after one minute or when the dialog box is closed. The snooze interval is 5 minutes and up to 10 snoozes are allowed. These values can be changed by ALARM(T, MSG, PROP, VAL, ...) where PROP can be one of the two:

'SnoozeInt' : snooze interval in seconds (default: 300)
'SnoozeCount' : number of maximum snoozes (default: 10)

T can also be a string of a specific time for the alarm. The string may be any of the following formats:
HH:MM, HH:MM:SS, HH:MM PM, HH:MM:SS PM.
If the date is specified, it is ignored. The alarm will go off at the next possible HH:MM:SS.

The dialog box is a QUESTDLG, which means that all execution will be halted until the user selects one of the buttons.

ALARM by itself will list all active alarms. It will display whether the alarm has not yet gone off (pending) or has been snoozed, the time til the next alarm, and the alarm message.

ALARM('-delete') will display the active alarms and give the option of deleting any of the alarms.

When an ALARM is initially defined, it can return the number of seconds before it will go off. Use semicolon to suppress this output.

This code uses a timer object, and it will delete itself once the alarm is turned off. Note that the timer can be deleted. When MATLAB closes, it will also be deleted and will NOT be restored at the next session. The purpose of this code is for a simple time reminder function for those long coding sessions one might have.

Example:
% alarm in 60 seconds
alarm(60, 'You can stop waiting now');

% alarm at 9 PM
alarm('9:00 PM', 'It''s 9 PM!!');

% snooze time of 3 minutes for a max of 5 snoozes
alarm(120, 'Hello!', 'SnoozeInt', 180, 'SnoozeCount', 5);

인용 양식

Jiro Doke (2024). ALARM (https://www.mathworks.com/matlabcentral/fileexchange/9018-alarm), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14SP2
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Clocks and Timers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

Updated license

1.0.0.0

Minor bug fixes and added examples in the help.