文档

输入规范

指定MATLAB的属性®function input variables to enable code generation

代码生成需要输入类型和属性的规范。代码生成器使用输入信息来确定为后续变量定义产生哪些类型,大小和其他属性。使用函数诸如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-globalsoption.

Value Classes

Specify Objects as Inputs at the Command Line

指定入口点输入是使用该值类的对象代码根-argsoption.

将对象指定为MATLAB编码器应用程序中的输入

从测试文件或示例输入中定义值类输入的类型。

Global Data

为全局数据生成代码

从MATLAB代码中生成C/C ++代码,该代码使用全局数据

使用应用程序添加全局变量

定义全局变量。

Specify Global Variable Type and Initial Value Using the App

指定MATLAB代码使用的全局变量的类型和初始值。

恒定数据

恒定输入检查MEX功能

控制MEX函数是否检查常数输入参数的值。

使用应用程序定义常数输入参数

Specify that an input parameter is a constant.

字符串标量

Define String Scalar Inputs

选择要指定字符串标量输入的方式。