Skip to Main Content Skip to Search
Product Documentation

coder.FiType class - Package: coder
Superclasses: coder.ArrayType

Represent set of MATLAB fixed-point arrays

Description

Specifies the set of fixed-point array values that the generated code should accept. Use with the fiaccel -args options.

Construction

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

t=coder.typeof(v, sz, variable_dims) returns a modified copy of coder.typeof(v) with (upper bound) size specified by sz and variable dimensions variable_dims. If sz specifies inf for a dimension, then the size of the dimension is unbounded and the dimension is variable size. When sz is [], the (upper bound) sizes of v do not change. If you do not specify the variable_dims input parameter, all the dimensions of the type are fixed, except for those that are unbounded. When variable_dims is a scalar, it applies to all the dimensions, except if the dimension is 1 or 0, which are fixed, or if the dimension is unbounded, which is always variable size.

t=coder.newtype('embedded.fi', numerictype, sz, variable_dims) creates a coder.Type object representing a set of fixed-point values with numerictype and (upper bound) sizes sz and variable dimensions variable_dims. If sz specifies inf for a dimension, then the size of the dimension is unbounded and the dimension is variable size. When you do not specify variable_dims, all the dimensions of the type are fixed, except for those that are unbounded. When variable_dims is a scalar, it applies to all the dimensions of the type, except if the dimension is 1 or 0, which is always fixed.

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

Input Arguments

v

Fixed-point value used to create new coder.FiType object.

sz

Size vector specifying each dimension of type object.

Default: [1 1] for coder.newtype

variable_dims

Logical vector that specifies whether each dimension is variable size (true) or fixed size (false).

Default: false(size(sz)) | sz ==Inf for coder.newtype

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'complex'

Set complex to true to create a coder.Type object that can represent complex values. The type must support complex data.

Default: false

'fimath'

Specify local fimath. If not, uses global fimath.

Properties

ClassName

Class of all values in the set.

Complex

Indicates whether fixed-point arrays in the set are real (false) or complex (true).

Fimath

Local fimath that the fixed-point arrays in the set use.

NumericType

numerictype that the fixed-point arrays in the set use.

SizeVector

The upper-bound size of arrays in the set.

VariableDims

A vector specifying whether each dimension of the array is fixed or variable size. If a vector element is true, the corresponding dimension is variable size.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.

Examples

Create a new fixed-point type t.

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

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

t = coder.newtype('embedded.fi',numerictype(1, 16, 15), [1 2])

t = 
% Returns
% coder.FiType
%   1x2 embedded.fi 
%          DataTypeMode: Fixed-point: binary point scaling
%          Signedness: Signed
%          WordLength: 16
%          FractionLength: 15

This new type uses the global fimath.

See Also

coder.ArrayType | coder.newtype | coder.resize | coder.Type | coder.typeof | fiaccel

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS