Matlab Help Index Technical Documentation Index

fwrite3

NAME ^

write a 3 byte integer out of a file

SYNOPSIS ^

function fwrite3(fid, val)

DESCRIPTION ^

 write a 3 byte integer out of a file
fwrite(fid, val, '3*uchar') ;

CROSS-REFERENCE INFORMATION ^

This function calls:

This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function fwrite3(fid, val)
0002 % write a 3 byte integer out of a file
0003 %fwrite(fid, val, '3*uchar') ;
0004 
0005 b1 = bitand(bitshift(val, -16), 255) ;
0006 b2 = bitand(bitshift(val, -8), 255) ;
0007 b3 = bitand(val, 255) ; 
0008 fwrite(fid, b1, 'uchar') ;
0009 fwrite(fid, b2, 'uchar') ;
0010 fwrite(fid, b3, 'uchar') ;
0011 
0012

Generated at 19:47:41 15-Oct-2003 by m2html © 2003