coder.write
Description
Use the coder.write function to create data files that the
generated code can read at run time. These files have the .coderdata
extension. Use this function in MATLAB® execution only and not the MATLAB code you intend to use for C/C++ code generation.
To read data from a .coderdata file in MATLAB execution and in the generated code, use the coder.read function. A
.coderdata file contains a type header that
specifies the type and size of the data stored in the file. The coder.read
function uses this information when interpreting the contents of the file.
coder.write(
accepts additional name-value arguments that you can use to:filename,data,Name=Value)
Specify a custom type header for the
.coderdatafile that is consistent with the variabledata.Omit the actual data and create a
.coderdatafile with a type header only.
Use this syntax to create a type header file, which is a
.coderdata file that you use to specify the type and size of data to
the coder.read function.
Examples
Input Arguments
Name-Value Arguments
Version History
Introduced in R2023a
See Also
coder.read | coder.load | fread | fwrite | fscanf | fprintf
Topics
- Perform Data Read and Write Operations in Generated Code (MATLAB Coder)