User`s guide
fwrite
14-26
14fwrite
Purpose Write binary data to the open target PC file
Syntax MATLAB command line
fwrite(file_obj,file_ID,A)
file_obj.fwrite(file_ID,A)
Arguments
Description Method of xpctarget.fs objects. From the host PC, writes the elements of
matrix
A to the file identified by file_ID. The data is written to the file in
column order. The
file_ID argument is the file identifier associated with an
open file (see
fopen). fwrite requires that the file be open with write
permission.
Examples Open the file data.dat in the target PC file system object fsys. Assign the
resulting file handle to a variable for writing.
h = fopen(fsys,'data.dat','w') or fsys.fopen('data.dat','w')
ans =
2883584
d = fwrite(fsys,h,magic(5));
This writes the elements of matrix A to the file handle h. This content is written
in column order.
See Also xPC Target file object methods fclose, fopen, and fread.
MATLAB
fwrite function.
file_obj
Name of the xpctarget.fs object.
file_ID
File identifier of the file to write.
A
Elements of matrix A to be written to the specified
file.