Home > bioelectromagnetism > freesurfer_fread3.m

freesurfer_fread3

PURPOSE ^

freesurfer_fread3 - read a 3 byte integer out of a file

SYNOPSIS ^

function [retval] = freesurfer_fread3(fid)

DESCRIPTION ^

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

 see also freesurfer_write3, freesurfer_read_surf, freesurfer_write_surf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [retval] = freesurfer_fread3(fid)
0002 
0003 % freesurfer_fread3 - read a 3 byte integer out of a file
0004 %
0005 % [retval] = freesurfer_fread3(fid)
0006 %
0007 % see also freesurfer_write3, freesurfer_read_surf, freesurfer_write_surf
0008 %
0009 
0010 b1 = fread(fid, 1, 'uchar') ;
0011 b2 = fread(fid, 1, 'uchar') ;
0012 b3 = fread(fid, 1, 'uchar') ;
0013 retval = bitshift(b1, 16) + bitshift(b2,8) + b3 ;

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003