Binary File Writer
Write data to binary files
DSP System Toolbox / Sinks
The Binary File Writer block writes multichannel signal data to a
binary file. The block specifies the name of the file and the structure of the header
that precedes the signal data. If there is no header to write, the block specifies an
struct(). The first time you write to the file,
the block writes the header, followed by the data. On subsequent calls, the block writes
the remaining data. If the header is empty, then no header is written.
The block writes the data in a row-major format. For example, if the input array is
1 2 4 5; 8 7 9 2], the block writes the data as [
1 2 4
5 8 7 9 2].
Port_1 — Data to write
column vector | row vector | matrix
The writer block writes the data to the file specified in the File name parameter. If the File header structure is not empty, then the writer writes the header before writing the data. The block can write floating-point data and integer data. The input data can be real or complex. When the data is complex, the block writes the data as interleaved real and imaginary components. The writer assumes the default endianness of the host machine.
Complex Number Support: Yes
File name — Name of the file
'Untitled.bin' (default) | character vector
Name of the file to which the block writes the data.
File header — Size of the header
struct() (default) | structure
The structure can have an arbitrary number of fields. Each field of the
structure must be a real matrix of a built-in type. For example, if
File header is set to
struct('field1',1:10,'field2',single(1)), the block
writes a header formed by 10 double-precision values,
(1:10), followed by 1 single precision value,
single(1). If there is no header to write, set this
parameter to an empty structure,
Simulate using — Type of simulation to run
Code generation (default) |
Specify the type of simulation to run as one of the following:
Code generation–– Simulate model using generated C code. The first time you run a simulation, Simulink generates C code for the block. Simulink reuses the C code in subsequent simulations as long as the model does not change. This option requires additional startup time but subsequent simulations are faster compared to
Interpreted execution–– Simulate model using the MATLAB® interpreter. This option shortens startup time but subsequent simulations are slower compared to
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2016b