Alert sound for warning me the program run overtime?
3 次查看(过去 30 天)
显示 更早的评论
Is there any alert function in matlab?
My program will display a message on the command window when reaches the end of every loop. (one loop about 200 seconds)
I want to have alert sound if my matlab program doesn't update over a certain time (e.g. 200 seconds) So, I can be notified that my program has problem (run overtime) in that loop.
Thank!!
0 个评论
回答(2 个)
Image Analyst
2015-2-19
Try soundsc(). Supply it with a filename of some sound you want it to play.
2 个评论
Image Analyst
2015-2-19
Are you still having trouble with this? You can use a timer to launch a sound or message box after a certain time. If it finishes before the warning time, you can stop the timer.
Andy
2015-2-19
Set up a timer at the start of the code i.e.
alert=timer('TimerFcn','beep','StartDelay',200,'Name','Timer-1')
At the start of the loop set the timer running: -
start(alert)
To stop the beep sounding if the loop works, immediately before you display the message on the command line, stop the timer
stop(alert)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!