tomwalters@0: % support file for 'aim-mat' tomwalters@0: % tomwalters@0: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: %%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: % tomwalters@0: % File: ReadBytes.m tomwalters@0: % Purpose: Reads a number of bytes from file. tomwalters@0: % Comments: tomwalters@0: % Author: L. P. O'Mard tomwalters@0: % Revised by: tomwalters@0: % Created: tomwalters@0: % Updated: tomwalters@0: % Copyright: (c) 2000, University of Essex tomwalters@0: % tomwalters@0: %%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: tomwalters@0: function bytes = ReadBytes(fid, n, swapBytes) tomwalters@0: tomwalters@0: bytes=fread(fid, n, 'char'); tomwalters@0: tomwalters@0: if (swapBytes ~= 0) tomwalters@0: for i = 1:n/2 tomwalters@0: temp = bytes(i); tomwalters@0: swapIndex = n - i + 1; tomwalters@0: bytes(i) = bytes(swapIndex); tomwalters@0: bytes(swapIndex) = temp; tomwalters@0: end; tomwalters@0: end; tomwalters@0: