Lfunction DistOut=discretize(conIn,samples,file)

a=0:1:samples;


for i=1:samples
DistOut(find(conIn<(i*(1/samples))&conIn>(i-1)*(1/samples)),1)=a(i);
end

if file~=0
    b=0;
    save file b   
    fid = fopen(file, 'w');
    for i=1:size(DistOut,1)
    fprintf(fid, '%d\n',DistOut(i));
    end
else
end
    