write a 3 byte integer out of a file fwrite(fid, val, '3*uchar') ;
This function calls:
This function is called by:
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