fread - Read open target PC file

Syntax

MATLAB® command line

fread(file_obj,file_ID)
file_obj.fread(file_ID)

Arguments

file_obj

Name of the xpctarget.fs object.

file_ID

File identifier of the file to read.

Description

Method of xpctarget.fs objects. From the host PC, reads the binary data from the file on the target PC and writes it into matrix A. The file_ID argument is the file identifier associated with an open file (see fopen).

Examples

Open the file data.dat in the target PC file system object fsys. Assign the resulting file handle to a variable for reading.

h = fopen(fsys,'data.dat') or fsys.fopen('data.dat')
ans =
     2883584
d = fread(h);

This reads the file data.dat and stores the contents of the file to d. This content is in the xPC Target™ file format.

See Also

xPC Target file object methods fclose, fopen, and fwrite.

MATLAB fread function.

  


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