function fwritebin(y,out_file,type)
%    fwritebin(y,out_file,type); 
%
%    FWRITEBIN writes the matrix y to the file specified by out_file in
%    the format given by type. Several different binary raw (e.g., no 
%    header formats are supported) as well as the standard PGM format.
%
%    Input:
%       y        : image matrix to save  
%       out_file : File name of output (e.g., 'image.pgm')
%       type     : matlab string expression defining data type
%                 'pgm'      --> portable graymap
%                 'uchar'    --> unsigned char  (default)
%                 'char'     --> char           (not implemented)
%                 'int'      --> int            
%                 'float'    --> float          
%                 'double'   --> double         
%                 'fcomplex' --> complex float  
%                 'dcomplex' --> complex double 
%
%    Output:
%
%    Example:
%       x = round(40*rand(20,40));
%       fwritebin(x,'x.pgm','pgm');
%
%    See also: freadbin

%File Name: fwritebin.m
%Last Modification Date: 9/1/95	08:51:44
%Current Version: fwritebin.m	1.5
%File Creation Date: Fri Feb  4 11:53:27 1994
%Author: Jan Erik Odegard  <odegard@jazz.rice.edu>
%
%Copyright: All software, documentation, and related files in this distribution
%           are Copyright (c) 1994  Rice University
%
%Permission is granted for use and non-profit distribution providing that this
%notice be clearly maintained. The right to distribute any portion for profit
%or as part of any commercial product is specifically reserved for the author.
%
%Change History:
%
