Simulink Reference | ![]() ![]() |
Library
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 transposition 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
untitled.mat
. If you specify an unqualified filename, Simulink stores the file in MATLAB's working directory. (To determine the working directory, type pwd
at the MATLAB command line.)1
.Characteristics
Sample Time |
Inherited from driving block |
Dimensionalized |
Yes |
![]() | Time-Based Linearization | To Workspace | ![]() |