Main Content

coder.FiType Class

Namespace: coder
Superclasses: coder.ArrayType

Represent set of MATLAB fixed-point arrays acceptable for input specification

Description

Objects of coder.FiType specify the fixed-point array values that the generated code accepts. Use objects of this class only with the -args options of the codegen command. Do not pass as an input to the generated MEX function.

Creation

t = coder.typeof(v) creates a coder.FiType object representing a set of fixed-point values whose properties are the same as the fixed-point input v.

t = coder.typeof(v,sz, variableDims) creates a coder.FiType object with upper bound sizes specified by sz and variable dimensions indicated in variableDims. If sz specifies Inf for a dimension, then the size of the dimension is unbounded and variable size. When sz is [], the upper bound sizes of v do not change. If you do not specify the variableDims, the bounded dimensions of the type are fixed. When variableDims is a scalar, this function applies this value to the bounded dimensions that are not 1 or 0, which are fixed.

t = coder.newtype('embedded.fi',numerictype,sz,variableDims) creates a coder.FiType object representing a set of fixed-point values with numerictype and upper bound sizes sz and variable dimensions indicated in variableDims. If sz specifies Inf for a dimension, then the size of the dimension is unbounded and the dimension is variable size. If you do not specify the variableDims, the bounded dimensions of the type are fixed. When variableDims is a scalar, this function applies this value to the bounded dimensions that are not 1 or 0, which are fixed.

t = coder.newtype('embedded.fi',numerictype,sz,variableDims,Name=Value) creates a coder.FiType object representing a set of fixed-point values with additional options specified by one or more name-value pair arguments. Name is a property name and Value is the corresponding value. You can specify several name-value arguments in any order as Name1=Value1,…,NameN=ValueN.

Note

You can create and edit coder.Type objects interactively by using the Coder Type Editor. See Create and Edit Input Types by Using the Coder Type Editor.

Input Arguments

expand all

Input variable, specified as a fixed-point numeric value.

Size of type object dimensions, specified as a vector of integers.

Option to specify whether each dimension has a variable size, specified as a boolean vector. If you specify an element of this vector as 1, the corresponding dimension has a variable size. Otherwise, the dimension has a fixed size.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Option to create a coder.FiType object that can represent complex values, specified as a numeric or logical 1 (true) or 0 (false).

Fixed-point math option, specified as a fimath object. If you do not specify this input, the coder.FiType object uses a fimath with default property values.

Properties

expand all

Value class name, returned as a string scalar.

Indication of whether the fixed-point arrays in the set are real or complex.

Fixed-point math option that the fixed-point arrays in the set use, returned as a fimath object.

Fixed-point representation option that the fixed-point arrays in the set use, returned as a numerictype object.

Upper-bound size of the arrays in the set, returned as vector of integers.

Option to specify whether each dimension of the array has a fixed or variable size. A value of 1 indicates that the corresponding element has a variable size. A value of 0 indicates that the corresponding element has a fixed size.

Examples

collapse all

Create the fixed-point type t.

t = coder.typeof(fi(1))
t = 
coder.FiType
   1×1 embedded.fi
             DataTypeMode: Fixed-point: binary point scaling
               Signedness: Signed
               WordLength: 16
           FractionLength: 14
   

Create a fixed-point type for use in code generation. The fixed-point type uses the default fimath object.

t = coder.newtype('embedded.fi',numerictype(1, 16, 15), [1 2])
t = 
coder.FiType
   1×2 embedded.fi
             DataTypeMode: Fixed-point: binary point scaling
               Signedness: Signed
               WordLength: 16
           FractionLength: 15
   

Version History

Introduced in R2011a