coder.runTest
运行测试取代调用MATLAB函数调用墨西哥人的功能
语法
fcn coder.runTest(测试)
coder.runTest(测试、fcns mexfcn)
mexfile coder.runTest(测试)
描述
例子
输入参数
提示
coder.runTest
不返回输出。看到测试结果,测试,包括代码,显示结果。墨西哥人比较和MATLAB函数行为:
在MATLAB运行测试。
使用
codegen
生成一个墨西哥人的功能。使用
coder.runTest
运行测试取代原始调用函数调用编译的版本在墨西哥人功能。
使用前
coder.runTest
测试多个函数,编制MATLAB函数为一个墨西哥人的功能。如果你使用语法
mexfile coder.runTest(测试)
,使用mexext
特定于平台的墨西哥人的文件扩展名。例如:coder.runTest (“my_test”,(“mymexfun”。,mexext])
如果在测试期间发生错误,你可以调试代码使用调用堆栈信息。
您可以将墨西哥人的生成和测试运行在一个步骤
codegen
与以及
选择。例如,下面的代码生成一个墨西哥人功能myfunction
并调用测试文件myfunction_test
,替换myfunction
与调用myfunction_mex
。codegenmyfunction以及myfunction_test
介绍了R2012a
这个主题有帮助吗?