Matlab Help Index Technical Documentation Index

fread3

NAME ^

[retval] = freadd3(fid)

SYNOPSIS ^

function [retval] = fread3(fid)

DESCRIPTION ^

 [retval] = freadd3(fid)
 read a 3 byte integer out of a file

CROSS-REFERENCE INFORMATION ^

This function calls:

This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [retval] = fread3(fid)
0002 % [retval] = freadd3(fid)
0003 % read a 3 byte integer out of a file
0004 
0005 b1 = fread(fid, 1, 'uchar') ;
0006 b2 = fread(fid, 1, 'uchar') ;
0007 b3 = fread(fid, 1, 'uchar') ;
0008 retval = bitshift(b1, 16) + bitshift(b2,8) + b3 ;
0009

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