输入规范
代码生成需要输入类型和属性的规范。代码生成器使用输入信息来确定为后续变量定义产生哪些类型,大小和其他属性。使用函数诸如coder.typeof
,,,,编码器
,,,,and断言
。For certain input types such as cells, classes, and globals, input specification can involve additional considerations.
功能
编码器。getArgTypes |
Determine types of function input arguments by executing test file |
coder.newtype |
创建一个coder.type对象 |
编码器 |
调整CODER.TYPE对象 |
coder.typeof |
创建coder.type对象以表示入口点函数输入的类型 |
编码器 |
声明可变大小数据 |
课程
编码器。arraytype |
表示MATLAB数组 |
编码器 |
Represent set of MATLAB cell arrays |
Coder.ClasStype |
表示MATLAB类 |
Coder.constant |
表示包含一个MATLAB值的集合 |
编码器 |
表示MATLAB枚举集 |
Coder.Fitype |
Represent set of MATLAB fixed-point arrays |
coder.PrimitiveType |
表示一组逻辑,数字或字符阵列 |
coder.StructType |
表示MATLAB结构阵列集 |
coder.Type |
Represent set of MATLAB values |
对象
coder.OutputType |
输出类型从入口点函数指定为输入类型 |
话题
输入规范基础知识
Specify Properties of Entry-Point Function Inputs
指定输入属性,以便代码生成器可以确定所有变量的属性。
提供一项测试,以使用代表性数据调用入口点功能。
Control the number of arguments in generated entry-point functions.
Define Input Properties Programmatically in the MATLAB File
Define the properties of entry-point function inputs with the断言
功能。
简化多个入口点功能的输入类型规范。
MATLABCoder应用程序
Define Input Parameter by Example by Using the App
Specify properties of an input parameter by providing an example value.
Define or Edit Input Parameter Type by Using the App
指定输入参数的类,大小和复杂性。
指定并应用规则以制作尺寸变量大小。
恢复并恢复对输入或全局变量定义的更改。
单元阵列
选择要指定单元格数输入的方式。
提供一个示例单元格数组,定义单元格数组类型或指定单元格阵列常数输入。
Specify global cell array inputs with the-globals
option.
Value Classes
Specify Objects as Inputs at the Command Line
指定入口点输入是使用该值类的对象代码根
-args
option.
从测试文件或示例输入中定义值类输入的类型。
Global Data
从MATLAB代码中生成C/C ++代码,该代码使用全局数据
定义全局变量。
Specify Global Variable Type and Initial Value Using the App
指定MATLAB代码使用的全局变量的类型和初始值。