join
类: matlab.unittest.diagnostics.Diagnostic
包: matlab.unittest.diagnostics
将多个诊断联接为一个数组
语法
diagArray = join(diag1,...,diagN)
输入参数
|
诊断内容,指定为 |
输出参数
|
连接的诊断内容的数组。
|
示例
备选方法
只要有一个值是诊断,您就可以使用数组串联将诊断连接成一个数组。join
方法避免了在数组中包含任何 Diagnostics
。请考虑以下示例。
arbitraryValue = 5; testCase.verifyThat(false, IsTrue, ... ['should have been true', ... @() system('ps'), ... arbitraryValue, ... MyCustomDiagnostic]);
由于 MyCustomDiagnostic
是一个 Diagnostic
,因此其他值也会正确转换为诊断。