Declare variable in generated code
y = coder.opaque(
declares
a variable type
)y
with the specified type and no
initial value in the generated code.
y
can be a variable or a structure
field.
MATLAB® code cannot set or access y
,
but external C functions can accept y
as an argument.
y
can be an:
Argument to coder.rref
, coder.wref
,
or coder.ref
Input or output argument to coder.ceval
Input or output argument to a user-written MATLAB function
Input to a subset of MATLAB toolbox functions supported for code generation
Assignment from y
declares another
variable with the same type in the generated code. For example:
y = coder.opaque('int'); z = y;
z
of
type int
in the generated code.You can assign y
from another variable
declared using either coder.opaque
or assignment
from a variable declared using coder.opaque
. The
variables must have identical types.
You can compare y
to another variable
declared using either coder.opaque
or assignment
from a variable declared using coder.opaque
. The
variables must have identical types.
y = coder.opaque(
declares
a variable type
,'HeaderFile'
,HeaderFile
)y
and specifies the header file that
contains the definition of type
. The code generator
produces the #include
statement for the header
file where required in the generated code.
y = coder.opaque(
declares
a variable type
,value
,'HeaderFile'
,HeaderFile
)y
with the specified type, initial
value, and header file in the generated code.