User`s guide
xpcbytes2file
Purpose Generate file suitable for use by From File block
Syntax xpcbytes2file(filename, var1, ...,varn)
Arguments
filename
NameofthedatafilefromwhichtheFromFile
block distributes data.
var1,...varn
Column of data to be output to the model.
Description The xpcbytes 2fil e function outputs one column of var1,..., varn at
every time step. All variables must have the s ame number of columns;
the number of rows and data types can differ.
Note You m ight have the data organized such that a row refers to a
single time step and not a column. In this case, pass to
xpcbytes2file
the transpose of the variable. To optimize file writes, organize the data
in columns.
Examples In the following example, to use the From File block to output a variable
errorval (single precision, scalar) and velocity (double, width 3) at
every time step, you can generate the file with the comm and:
xpcbytes2file('myfile', errorval, velocity)
where errorval has class ' single' and dimensions [1 x N] and
velocity has class 'double' and dimensions [3 x N].
Set up the From File block to output
28 bytes
(1 * sizeof('single') + 3 * s izeo f('double'))
at every sample time.
18-154