xpcbytes2file - Generate file suitable for use by From File block

Syntax

xpcbytes2file(filename, var1, ...,varn)

Arguments

filename

Name of the data file from which the From File block distributes data.

var1,...varn

Column of data to be output to the model.

Description

The xpcbytes2file function outputs one column of var1,..., varn at every time step. All variables must have the same number of columns; the number of rows and data types can differ.

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 command:

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 * sizeof('double'))

at every sample time.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS