% Peter Corke 1996 function im = loadinr(fname, im) fid = fopen(fname, 'r'); s = fgets(fid); if strcmp(s(1:12), '#INRIMAGE-4#') == 0, error('not INRIMAGE format'); end % not very complete, only looks for the X/YDIM keys while 1, s = fgets(fid); n = length(s) - 1; if s(1) == '#', break end if strcmp(s(1:5), 'XDIM='), cols = str2num(s(6:n)); end if strcmp(s(1:5), 'YDIM='), rows = str2num(s(6:n)); end if strcmp(s(1:4), 'CPU='), if strcmp(s(5:n), 'sun') == 0, <