| Contents | Index |
Represent set of MATLAB enumerations
Specifies the set of MATLAB enumerations that the generated code should accept. Use with the fiaccel -args options.
enum_type = coder.typeof(enum_value) creates a coder.EnumType object representing a set of enumeration values of class (enum_value).
enum_type = coder.typeof(enum_value, sz, variable_dims) returns a modified copy of coder.typeof(enum_value) 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 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, except if the dimension is 1 or 0, which are fixed, or if the dimension is unbounded, which is always variable size.
enum_type = coder.newtype(enum_name,sz,variable_dims) creates a coder.EnumType object that has variable size with (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. If 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.
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.
Create a coder.EnumType object using a value from an existing MATLAB enumeration.
Define an enumeration MyColors. On the MATLAB path, create a file named 'MyColors' containing:
classdef(Enumeration) MyColors < int32
enumeration
green(1),
red(2),
end
end
Create a coder.EnumType object from this enumeration.
t = coder.typeof(MyColors.red);
Create a coder.EnumType object using the name of an existing MATLAB enumeration.
Define an enumeration MyColors. On the MATLAB path, create a file named 'MyColors' containing:
classdef(Enumeration) MyColors < int32
enumeration
green(1),
red(2),
end
end
Create a coder.EnumType object from this enumeration.
t = coder.newtype('MyColors');
coder.ArrayType | coder.newtype | coder.resize | coder.Type | coder.typeof | fiaccel

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 |