matlab - 在 MATLAB 中消除警告消息

标签 matlab

有时,根据图像的大小,当我调用 addframe 时在 MATLAB 中向视频添加 2D 图像时,我收到以下警告消息。

Warning: The frame height has been padded to be a multiple of four as required by the specified codec. In avifile.addframe at 127

我的问题是:

  1. 是否有任何方法可以像这样消除特定警告?如果是这样,是否可以在我的代码中的变量中捕获警告(即类似于 try & catch 异常机制)而不是让 MATLAB 在命令窗口中打印此警告?

  2. 如果上述情况不可行。有没有办法在 MATLAB 中暂时消除所有警告

最佳答案

使用 warning 命令,您可以通过 ID 关闭所有警告或特定警告:

WARNING('OFF', 'MSGID') and WARNING('ON', 'MSGID') disable and enable the display of any warning tagged with message identifier MSGID. (Use LASTWARN to determine the identifier of a warning, or use the WARNING VERBOSE feature described below.) WARNING is not case sensitive when matching message identifiers.

有关warning 命令的更多帮助,请在 MATLAB 命令行中键入 help warning

关于matlab - 在 MATLAB 中消除警告消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6651208/

相关文章:

matlab - 无法获得 Σ-Δ 调制器所需的 FFT

用于依赖分析的Matlab函数

image - Matlab 中观察值和变量之间的差异

大量高斯混合模型的MATLAB代码

matlab - 如何为 3D 条形图中的条设置任意颜色?

python - 如何使用 Python 在 OpenCV 中合成两个图像?

c# - metro 应用中的图像处理

matlab - 为什么 Matlab 可以将空矩阵与单例矩阵进行比较?

c - 反转位图图像将图像变黑。但不一致

c - 基本线性代数算法(MATLAB 和 C)