Using Simulink    
To File

Write data to a file.

Library

Sinks

Description

The To File block writes its input to a matrix in a MAT-file. The block writes one column for each time step: the first row is the simulation time; the remainder of the column is the input data, one data point for each element in the input vector. The matrix has this form.

The From File block can use data written by a To File block without any modifications. However, the form of the matrix expected by the From Workspace block is the transpose of the data written by the To File block.

The block writes the data as well as the simulation time after the simulation is completed. The block icon shows the name of the specified output file.

The amount of data written and the time steps at which the data is written are determined by block parameters:

If the file exists at the time the simulation starts, the block overwrites its contents.

Data Type Support

A To File block accepts real signals of type double.

Parameters and Dialog Box

Filename
The name of the MAT-file that holds the matrix.
Variable name
The name of the matrix contained in the named file.
Decimation
A decimation factor. The default value is 1.
Sample time
The sample time at which to collect points.

Characteristics

Sample Time
Inherited from driving block
Dimensionalized
Yes


 Terminator To Workspace