Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to silence the 'hold' function in Matlab

Tags:

matlab

I'm doing some data analysis in Matlab, and anytime I call the hold function to keep plotting to the current figure, I get an output like this:

Current plot held

I'd like to avoid this print, since it's just ugly and clutters my output. Unfortunately, placing a ; after the command does not silence it.

Is there something I can do (save from reworking my display code to avoid 'hold' commands altogether)?

like image 652
Kena Avatar asked Dec 22 '08 16:12

Kena


1 Answers

Looks like the hold command displays "Current plot held" if you call it with the axis handle as the sole parameter, e.g.

>> hold(gca)
Current plot released
>> hold(gca)
Current plot held

However, if you tell it the hold state you want then the output is suppressed, e.g.,

>> hold(gca,'on')
>>

You could also call hold in the following manner

>> axes(axesHandle)
>> hold on % or hold('on') if you prefer calling it as a function

If you want to avoid using the hold command/function, you could set the NextPlot property of the axis to add, e.g.

>> axesHandle=axes;
>> set(axesHandle,'NextPlot','add')
like image 178
Azim J Avatar answered Oct 19 '22 14:10

Azim J