| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
xpcbytes2file(filename, var1, ...,varn)
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. |
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.
Note You might 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. |
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.
![]() | xpcbootdisk | xpcexplr | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |