function [X] = writeraw(rawfile, Outfile) % LOADRAW Load Raw image files. % % [X]=LOADRAW(rawfile, Width, Height) loads a raw image file % specified by "rawfile", returning the image data in variable % "X". The .RAW extension in the filename is optional. % Andrew Segall % January, 1996 if nargin~=2 error('LOADRAW takes three arguments.'); end if isempty(findstr(rawfile,'.')), rawfile=[rawfile,'.raw']; end fid=fopen(rawfile,'wb','ieee-le'); if fid==-1 error('Can''t open .RAW file for input!'); end Outfile=Outfile'; X=fwrite(fid,Outfile,'uint8'); fclose(fid);