coder.write
Description
coder.write(
stores the argument fileName
,data
)data
in a file with the name
fileName.coderdata
in your current directory. Use this function in
MATLAB® execution only and not the MATLAB code you intend to use for C/C++ code generation.
Use the coder.read
function to
read data from a .coderdata
file in MATLAB and in the generated code.
A .coderdata
file contains a type header that
specifies the type and size of the data stored in the file. The code generated for the
coder.read
function can read any .coderdata
file at
run-time, whose type and size is consistent with the type and size information that you
supply to coder.read
during code generation.
coder.write(
creates a type header file, which is a fileName
,data
,Name=Value
).coderdata
file that you use to specify the type and size of data to the coder.read
function. Use the name-value arguments to:
Specify a custom type header for the
.coderdata
file that is consistent with the variabledata
.Omit the actual data and create a
.coderdata
file with a type header only.
Examples
Input Arguments
Version History
Introduced in R2023a
See Also
coder.read
| coder.load
| fread
| fwrite
| fscanf
| fprintf
Topics
- Data Read and Write Considerations (MATLAB Coder)