MATLAB: Toggling messages on and off in command window

command window dialog

I would like to know if there is a simple command that will toggle the command window text on and off. For instance, I have a gui function that generates multiple plots using the hold command. Unfortunately, every time I update the multiplot by calling the function, matlab produces "Current plot held" and "Current plot released" dialog in the command window. After many updates a long string of this matlab chatter will be generated in the command window.
Thanks for sharing your insights

Best Answer

Instead of just using
hold
to toggle the hold state, specifically use
hold on
or
hold off
Those do not produce messages.
At least as of 2008b, the messages are produced via disp(), so if for some reason it is important to continue to use hold without an argument, use
evalc('hold');
The evalc() will execute the given string and capture the command window output, and the semi-colon would then discard that output.
If editing the current source would be too much work, you could add your own version of hold.m earlier on the path, and have it call the MATLAB-provided one (an operation that would be a bit tricky.)