function res=lanim(A,r,c,fact)

[nr,nc]=size(A)
res =zeros(r,c);
len(nc)=0;

for io=1:nc;
        for jo=1:nr;
                if (A(jo,io)> 0) len(io)=len(io)+1;
                end;
        end;
end;

for io=1:nc;
	if (len(io) > fact*nr) 
	for jo=1:min(nr,r);
		cpos=A(jo,io);
		if (cpos > 0 ) & (cpos < c)
			res(jo,cpos)=io;
		end;
	end;
	end;
end;
end;

