有什么办法可以使Matlab中的``保持''功能静音 [英] Is there any way to silence the 'hold' function in Matlab

查看:103
本文介绍了有什么办法可以使Matlab中的``保持''功能静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Matlab中进行一些数据分析,每当我调用hold函数以保持绘制到当前图形时,都会得到如下输出:

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)?

推荐答案

如果将轴手柄作为唯一参数,例如,调用hold命令,则显示当前曲线已保持",例如

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

如果要避免使用hold命令/功能,可以将轴的 NextPlot 属性设置为 add ,例如

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')

这篇关于有什么办法可以使Matlab中的``保持''功能静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆