You can define table inputs at the command line or in the MATLAB®
Coder™ app. Programmatic specification of table input types by using preconditioning
(assert
statements) is not supported.
Use one of these procedures:
Alternatively, if you have a test file that calls your entry-point function with example
inputs, you can determine the input types by using
coder.getArgTypes
.
Use the -args
option:
T = table(A,B,C,'VariableNames',vnames); codegen myFunction -args {T}
To provide a type for a table to codegen
:
Define a table. For example:
T = table(A,B,C,'VariableNames',vnames);
Create a type from
T
.
t = coder.typeof(T);
Pass the type to codegen
by using the
-args
option.
codegen myFunction -args {t}
To specify that a table input is constant, use coder.Constant
with the
-args
option:
T = table(A,B,C,'VariableNames',vnames); codegen myFunction -args {coder.Constant(T)}
Use one of these procedures:
coder.Constant
| coder.typeof
| table