Communications Blockset | ![]() ![]() |
Read from a file, refreshing the output at rising edges of an input signal
Library
Controlled Sources sublibrary of Comm Sources
Description
The Triggered Read From File block reads a new record from a file only at the rising edge of the input trigger signal. The output is a sample-based signal.
Note The triggered behavior of this block is one difference between this block and Simulink's From File block. However, the From File block is useful for reading platform-independent MAT-files. |
The file can be an ASCII text file, a file containing integer or floating point numbers, or a binary file (in the format of the C fwrite
function). The file must be either in the current working directory on the MATLAB path.
When a rising edge of the input trigger signal is detected, this block reads from the file a record whose length is specified in the parameter Output vector length. The first reading always occurs at the first rising edge. After that, if the Decimation parameter is a positive integer k, then the block reads at every kth rising edge. If Decimation is 1
, then the block reads at every rising edge.
When the block reaches the end-of-file marker, it either:
If the Data type parameter is ASCII, then the output is an integer. The mapping between decimal integers and ASCII characters is shown below.
Dialog Box
Pair Block
See Also
To File (Simulink)
![]() | Tanh Nonlinearity | Triggered Write to File | ![]() |