Input Specification

Input parameter type, size, complexity; constants, variable-size inputs, global variables

Functions

coder.getArgTypes Determine types of function input arguments by running test file
coder.newtype Create a coder.Type object
coder.resize Resize a coder.Type object
coder.typeof Convert MATLAB value into its canonical type
coder.varsize Declare variable-size array

Classes

coder.ArrayType Represent set of MATLAB arrays
coder.CellType Represent set of MATLAB cell arrays
coder.Constant Represent set containing one MATLAB value
coder.EnumType Represent set of MATLAB enumerations
coder.FiType Represent set of MATLAB fixed-point arrays
coder.PrimitiveType Represent set of logical, numeric, or char arrays
coder.StructType Represent set of MATLAB structure arrays
coder.Type Represent set of MATLAB values

Examples and How To

Automatically Define Input Types by Using the App

Provide a test that calls the entry-point functions with representative data.

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 the class, size, and complexity of an input parameter.

Make Dimensions Variable-Size When They Meet Size Threshold

Specify and apply rules for making dimensions variable-size.

Define Input Properties by Example at the Command Line

Specify entry-point function input properties with the -args option.

Define Input Properties Programmatically in the MATLAB File

Define the properties of entry-point function inputs with the assert function.

Specify Variable-Size Inputs at the Command Line

Specify data whose size might change at run time.

Define Constant Input Parameters Using the App

Specify that an input parameter is a constant.

Specify Constant Inputs at the Command Line

Specify a constant input by using -args with coder.Constant.

Define Cell Array Inputs

Choose how you want to specify cell array inputs.

Specify Cell Array Inputs at the Command Line

Provide an example cell array, define a cell array type, or specify a cell array constant input.

Control Constant Inputs in MEX Function Signatures

Specify whether MEX function signatures include constant inputs.

Declare Global Variables

When using global data, you must first declare the global variables in your MATLAB® code.

Define Global Data

You can define global data in the MATLAB global workspace, in a MATLAB Coder™ project, or at the command line.

Define Constant Global Data

Define constant global variables in the app or at the command line.

Add Global Variables by Using the App

Define global variables.

Specify Global Variable Type and Initial Value Using the App

Specify type and initial value of global variables that your MATLAB code uses.

Specify Global Cell Arrays at the Command Line

Specify global cell array inputs with the -globals option.

Undo and Redo Changes to Type Definitions in the App

Revert and restore changes to input or global variable definitions.

Concepts

Primary Function Input Specification

Specify properties of entry-point function inputs.

Was this topic helpful?