% returns multi channel frames in separate channels

function a2 = myname(l)

M=240;
N=320;
MN=M*N;

myfidinteger = fopen('swarped/data');

fseek(myfidinteger,l*MN*3+2*MN,-1); % position l frames from beginning of file
[a2, count]=fread(myfidinteger,M*N,'uchar');
if count~=MN
  error(sprintf('getframe: only read %d of %d elements, third channel %d',count,MN))
end%if

fclose(myfidinteger);

a2=reshape(a2,N,M);

a2=a2.';

disp(sprintf('loadframe.m: cropping frame %d to 230 by 310',l))
a2=a2(2:M-8,3:N-7);

