Main Content

输入设定

指定 MATLAB® 函数输入变量的属性以启用代码生成

代码生成需要设定输入类型和属性。代码生成器使用输入信息来确定在后续变量定义中应如何定义变量的类型、大小及其他属性。通过 App、命令行或使用代码生成器生成类型编辑器,使用 coder.typeofcoder.varsizeassert 等函数在函数代码的外部或内部来执行输入设定。对于某些输入类型,如元胞、类和全局变量,输入设定可能涉及其他考虑事项。

函数

coder.getArgTypesDetermine types of function input arguments by executing test file
coder.newtypeCreate coder.Type object to represent type of an entry-point function input
coder.resize调整 coder.Type 对象的大小
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.varsize声明可变大小数据
coderTypeEditorLaunch the Coder Type Editor dialog

coder.ArrayTypeRepresent set of MATLAB arrays acceptable for input specification
coder.CellTypeRepresent set of MATLAB cell arrays
coder.ClassTypeRepresent set of MATLAB classes acceptable for input specification
coder.ConstantSpecification of constant value for code generation
coder.EnumTypeRepresent set of MATLAB enumerations acceptable for input specification
coder.FiTypeRepresent set of MATLAB fixed-point arrays acceptable for input specification
coder.PrimitiveTypeRepresent set of logical, numeric, or character arrays acceptable for input specification
coder.StructTypeRepresent set of MATLAB structure arrays acceptable for input specification
coder.StringTypeRepresent set of MATLAB strings acceptable for input specification
coder.TypeRepresent set of MATLAB values acceptable for input specification

对象

coder.OutputTypeOutput type from an entry-point function to specify as an input type

主题

输入设定基础知识

MATLAB Coder App

元胞数组

值类

全局数据

常量数据

字符串标量