User`s guide

fread
length(A) might be less than the number of bytes requested if that
number of bytes are not currently available. It is zero if the operation
reaches the end of the file.
Examples Open the file dat a.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 all of 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,andfwrite.
MATLAB
fread function.
18-23