MATLAB: Help me about sound in Matlab

guideMATLAB

when I use msgbox. I'd like it have a sound when the msgbox appear. How do I do that ? thanks very much.

Best Answer

You cannot exactly synchronize them, but you can set up an audioplayer() and use its play() method just before you start the msgbox, and you can stop() it when the user dismissed the msgbox() . See also waitfor() to detect the dismissal of the msgbox()
Related Question