How to make Matlab play a specific sound any time (and every time) an error occurs and a different sound when the code finishes normally?

3 次查看(过去 30 天)
I'm looking for a way have sound display every time a specific action occurs, for example a beep when an error occurs and a honk when a code finishes. I know that I could put in try, catch and sound if it all works, but I'm looking for a way to do this so it happens every time always. Another way to conceptualize the problem is that anytime red text appears in the command window, make a beep, and anytime >> appears without red text, make a honk.
I was thinking about using groot and the startup file. But I don't know what specific parameters to call or edit.
I'm hoping this is possible with my rational being that, every time an error occurs anywhere, some code is being called to say "Hey, send some red text to the command window." If I could even just piggy back off that and say "Hey, send some red text to the command window, and also play a beep noise", that would be fantastic.
I'm running MATLAB 2018a on Windows 10 64x

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by