matlab - 警告消息标识符

标签 matlab warnings

我想在我的 MATLAB 代码中包含 warning() 命令。具有讽刺意味的是,这样做时,我在代码编辑器中收到一条警告消息,提示我无法转移。

如果我使用 warning('Warning message!') 行,代码编辑器会告诉我需要包含一个“消息标识符”作为第一个参数。因此,我查阅了 help warning,它告诉我“消息标识符”只是一个字符串。

如果我使用以下行: warning('identifier','Warning message!'),我仍然收到编辑的投诉。首先,它仍然要我添加一个“消息标识符”作为第一个参数。此外,它现在告诉我“格式字符串可能与参数计数不一致”。

我该如何解决?

我使用的是 MATLAB 2012a。

最佳答案

尝试这样的事情:

warning('myfun:warncode','Warning message!')

关于matlab - 警告消息标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17878236/

相关文章:

clang - 完整的Clang警告列表及其说明

java - 在 Android 上使用 List<String> 发出警告

warnings - TYPO3:如何抑制弃用警告?

matlab - Mex 文件 : how to return an already allocated matlab array

matlab - 带有预计算内核的 libsvm : How do I compute the classification scores?

matlab - 为什么 MATLABs "imwrite"缩放 12 位图像以及如何避免这种情况?

python - 用户警告的堆栈跟踪

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP

algorithm - 通过增加 A 的大小来测量求解线性系统 Ax=b 的计算复杂度

matlab - 如何在 Matlab 图形中使用非 ASCII 字符(用于 LaTeX 文档)?