Main Content

Input Specification

Specify properties of MATLAB® function input variables to enable code generation

Specification of input types and properties is required for code generation. The code generator uses the input information to determine what types, sizes, and other properties are produced for subsequent variable definition. Perform input specification from the app, at the command line, or by using the Coder Type Editor, and from outside or inside of your function code, using functions such as coder.typeof, coder.varsize, and assert. For certain input types such as cells, classes, and globals, input specification can involve additional considerations.


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.resizeResize coder.Type object
coder.typeofCreate coder.Type object to represent the type of an entry-point function input
coder.varsizeDeclare variable-size data
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


Input Specification Basics

MATLAB Coder App

Cell Arrays

Value Classes

Global Data

Constant Data

String Scalars