Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Matlab中,当发出自定义警告时,消息id无法识别。我如何纠正这个问题?_Matlab_Compiler Warnings - Fatal编程技术网

在Matlab中,当发出自定义警告时,消息id无法识别。我如何纠正这个问题?

在Matlab中,当发出自定义警告时,消息id无法识别。我如何纠正这个问题?,matlab,compiler-warnings,Matlab,Compiler Warnings,我在代码中发出警告,如下所示- warning('Custom:data-missing','Can''t access Customer Terms for data point #%d.',i) 当在命令窗口中触发时,我看到 Warning: Custom:data-missing > In asr_stfr_terms at 97 为什么会这样?为什么Matlab不打印警告消息,而是打印消息\u id?不允许使用“-” warning('Custom:dataMissing',

我在代码中发出警告,如下所示-

warning('Custom:data-missing','Can''t access Customer Terms for data point #%d.',i)
当在命令窗口中触发时,我看到

Warning: Custom:data-missing 
> In asr_stfr_terms at 97

为什么会这样?为什么Matlab不打印警告消息,而是打印消息\u id?

不允许使用“-”

warning('Custom:dataMissing','Can''t access Customer Terms for data point #%d.',i)

谢谢你,伙计!看来我最后做了些傻事。你知道文档中有没有提到这一点吗?@UditG:没有找到任何内容,否则我会提到允许的字符。如果你键入
help warning
,你会看到它确实说消息ID必须由字母数字字符串组成(也就是说,只有字母和数字,除了冒号之外没有标点符号来分隔消息的组成部分)。但是由于某种原因,
doc warning
,没有透露这些信息。不管怎样,这都是一个非常恼人的限制,我看不出有必要。谢谢Daniel&Sam。@SamRoberts谢谢你的解释,伙计。