function viterbipfad=randViterbi(States,length)
viterbipfad=zeros(1:length,1);
a=0:1:States-1;
R = rand(length,1);

    for i=1:States
viterbipfad(find(R<(i*(1/States))&R>(i-1)*(1/States)),1)=a(i);
    end

