%FREAD  Read binary data from file.
%   [A, COUNT] = FREAD(FID,SIZE,PRECISION) reads binary data from the
%   specified file and writes it into matrix A.  Optional output
%   argument COUNT returns the number of elements successfully read. 
%   
%   FID is an integer file identifier obtained from FOPEN.
%   
%   The size argument is optional; if not specified, the entire
%   file is read; if specified, valid entries are:
%       N      read N elements into a column vector.
%       inf    read to the end of the file.
%       [M,N]  read elements to fill an M-by-N matrix, in column order.
%              N can be inf, but M can't.
%   
%   The precision argument controls the number of bits read for each value
%   and the interpretation of those bits as character, integer or floating
%   point values.  Any of the following strings, either the MATLAB
%   versions, or their C or Fortran equivalents, may be used.  If not
%   specified, the default is 'uchar'.  By default, numeric values are
%   returned in double precision arrays.
%   
%       MATLAB    C or Fortran     Description
%       'uchar'   'unsigned char'  unsigned character,  8 bits.
%       'schar'   'signed char'    signed character,  8 bits.
%       'int8'    'integer*1'      integer, 8 bits.
%       'int16'   'integer*2'      integer, 16 bits.
%       'int32'   'integer*4'      integer, 32 bits.
%       'int64'   'integer*8'      integer, 64 bits.
%       'uint8'   'integer*1'      unsigned integer, 8 bits.
%       'uint16'  'integer*2'      unsigned integer, 16 bits.
%       'uint32'  'integer*4'      unsigned integer, 32 bits.
%       'uint64'  'integer*8'      unsigned integer, 64 bits.
%       'single'  'real*4'         floating point, 32 bits.
%       'float32' 'real*4'         floating point, 32 bits.
%       'double'  'real*8'         floating point, 64 bits.
%       'float64' 'real*8'         floating point, 64 bits.
%
%   The following platform dependent formats are also supported but
%   they are not guaranteed to be the same size on all platforms.
%       'char'    'char*1'         character,  8 bits (signed or unsigned).
%       'short'   'short'          integer,  16 bits.
%       'int'     'int'            integer,  32 bits.
%       'long'    'long'           integer,  32 or 64 bits.
%       'ushort'  'unsigned short' unsigned integer,  16 bits.
%       'uint'    'unsigned int'   unsigned integer,  32 bits.
%       'ulong'   'unsigned long'  unsigned integer,  32 bits or 64 bits.
%       'float'   'float'          floating point, 32 bits.
%
%   The following formats map to an input stream of bits rather than
%   bytes.
%
%       'bitN'                     signed integer, N bits  (1<=N<=64).
%       'ubitN'                    unsigned integer, N bits (1<=N<=64).
%
%   The PRECISION string may contain a positive integer repetition
%   factor of the form 'N*' which prepends one of the strings above,
%   like '40*uchar'.
%
%   For example,
%       fid = fopen('fread.m','r');
%       F = fread(fid);
%       s = setstr(F')
%
%   opens the file containing this HELP entry, then reads and displays
%   the entire file, using default size = inf and precision = 'uchar'.
%   The resulting length(F) is the number of characters in the file.
%
%   [A, COUNT] = FREAD(FID,SIZE,PRECISION,SKIP) includes an optional SKIP
%   argument that specifies the number of bytes to skip after each
%   PRECISION value is read. With the SKIP argument present, FREAD
%   reads in one value and does a skip of input, reads in another value
%   and does a skip of input, etc. for at most SIZE times. If PRECISION
%   is a bit format like 'bitN' or 'ubitN' SKIP is specified in bits.
%   This is useful for extracting data in noncontiguous fields from
%   fixed length records.
%
%   See FOPEN on how to read big- and little-endian files.
%
%   See also FWRITE, FSEEK, FSCANF, FGETL, FGETS, LOAD, FOPEN.

%   [A,COUNT] = FREAD(...,MACHINEFORMAT) also accepts a MACHINEFORMAT
%   parameter (see FOPEN for details). 

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.12 $  $Date: 1998/06/19 21:03:39 $
%   Built-in function.
