| Contents | Index |
Represent a set of MATLAB structure arrays
Specifies the set of structure arrays that the generated code should accept. Use with the fiaccel -args option.
t=coder.typeof(struct_v) creates a coder.StructType object for a structure with the same fields as the scalar structure struct_v.
t=coder.typeof(struct_v, sz, variable_dims) returns a modified copy of coder.typeof(struct_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 assumed to be unbounded and the dimension is assumed to be variable sized. When sz is [], the (upper bound) sizes of struct_v remain unchanged. If the variable_dims input parameter is not specified, all the dimensions of the type are assumed to be fixed except for those that are unbounded. When variable_dims is a scalar, it is applied to all the dimensions, except if the dimension is 1 or 0, which are assumed to be fixed, or if the dimension is unbounded, which is assumed to be always variable sized.
t=coder.newtype('struct', struct_v, sz, variable_dims) creates a coder.StructType object for an array of structures with the same fields as the scalar structure struct_v and (upper bound) size sz and variable dimensions variable_dims. If sz specifies inf for a dimension, then the size of the dimension is assumed to be unbounded and the dimension is assumed to be variable sized. When variable_dims is not specified, all the dimensions of the type are assumed to be fixed except for those that are unbounded. When variable_dims is a scalar, it is applied to all the dimensions of the type, except if the dimension is 1 or 0, which is assumed to be always fixed.
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.
Create a type for a structure with a variable-size field.
x.a = coder.typeof(0,[3 5],1); x.b = magic(3); coder.typeof(x) % Returns % coder.StructType % 1x1 struct % a: :3x:5 double % b: 3x3 double % ':' indicates variable-size dimensions
Create a coder.StructType object that uses an externally-defined structure type.
Create a type that uses an externally-defined structure type.
S.a = coder.typeof(double(0)); S.b = coder.typeof(single(0)); T = coder.typeof(S); T = coder.cstructname(T,'mytype','extern','HeaderFile','myheader.h');
T =
coder.StructType
1x1 extern mytype (myheader.h) struct
a: 1x1 double
b: 1x1 singleView the types of the structure fields.
T.Fields
ans =
a: [1x1 coder.PrimitiveType]
b: [1x1 coder.PrimitiveType]coder | coder.ArrayType | coder.Constant | coder.EnumType | coder.FiType | coder.newtype | coder.PrimitiveType | 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 |