帮助中心帮助中心
本页的翻译已过时。点击此处可查看最新英文版本。
验证值未缺失
mustBeNonmissing(value)
示例
如果 value 包含缺失值,则 mustBeNonmissing(value) 会引发错误。此函数不返回值。
value
mustBeNonmissing 调用以下函数来确定输入是否没有缺失值:
mustBeNonmissing
ismissing
支持的类:重载 ismissing 的所有数值类、string 和 MATLAB® 类。
string
全部折叠
labelPlot 函数接受 1×3 字符串数组,并使用元素对 x 坐标区和 y 坐标区加标签并添加标题。该函数不允许缺失数组元素。
labelPlot
function labelPlot(labels) arguments labels (1,3) string {mustBeNonmissing} end xlabel(labels(1)) ylabel(labels(2)) title(labels(3)) end
创建一个图,并使用 labelPlot 函数添加标签和标题。函数输入数组包含一个缺失元素,因此 mustBeNonmissing 函数会引发错误。
plot(1:10) strLabels = ["X Label",string(missing),"My Plot"]; labelPlot(strLabels)
Error using labelPlot labelPlot(strLabels) ↑ Invalid argument at position 1. Value must not have missing data.
要验证的值,指定为支持 ismissing 函数的任何 MATLAB 类型或用户定义对象的数组。
mustBeNonmissing 用于属性和函数参数验证。
有关不同类型值的缺失值构成的信息,请参阅 ismissing 函数。
arguments | mustBeNonempty
arguments
mustBeNonempty
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office