% returns multi channel frames in separate channels

function a1 = myname(l)

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

myfidinteger = fopen('swarped/data');

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

fclose(myfidinteger);

a1=reshape(a1,N,M);

a1=a1.';

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

