Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 1001;
- R = 1:n;
- R(1) = 0;
- for i = 2:1:n
- R(i) = (11 * R(i - 1) + pi) - fix(11 * R(i - 1) + pi);
- end
- x = (R / n);
- subplot(2,2,1); hist(x);
- subplot(2,2,2); plot(sort(x), [1:n] / n);
- T = 1000; G = rand(1,T);
- subplot(2,2,3); hist(G);
- subplot(2,2,4); plot(sort(G), [1:T] / T);
- j = 0:0.001:1;
- f = unifcdf(j, 0, 1);
- R=sort(R);
- [C, ii] = unique(R, 'first');
- XX = unique(R);
- YY = ii / n;
- YY = YY'; % траспонирование
- figure()
- plot(R, [1:n]/n);
- for l=1:length(XX)
- line([XX(l) YY(l)],[YY(l) YY(l)]);
- end
- figure()
- for i = 1:1:n
- ks(i) = abs((f(i) - R(i)));
- kv(i) = f(i) - R(i);
- end
- kss = max(ks);
- ksv = max(kv);
- plot(j, f)
- hold on
- plot(R, [1:n] / n);
- xlabel('zn CB')
- ylabel('ver')
- hold on
- plot(R, [1:n] / n - kss, 'k');
- P = 1 - 2 * exp(-2n0.0786^2);
- FK = xcorr(R,'coeff');
- FT = xcorr(sort(G),'coeff');
- figure()
- plot(FK);
- xlim([0 2 * n])
- hold on
- plot(FT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement