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?

8 visualizzazioni (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by