Advertisement
Dimique

Untitled

May 13th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. n = 1001;
  2. R = 1:n;
  3. R(1) = 0;
  4. for i = 2:1:n
  5. R(i) = (11 * R(i - 1) + pi) - fix(11 * R(i - 1) + pi);
  6. end
  7. x = (R / n);
  8.  
  9. subplot(2,2,1); hist(x);
  10. subplot(2,2,2); plot(sort(x), [1:n] / n);
  11. T = 1000; G = rand(1,T);
  12. subplot(2,2,3); hist(G);
  13. subplot(2,2,4); plot(sort(G), [1:T] / T);
  14.  
  15. j = 0:0.001:1;
  16. f = unifcdf(j, 0, 1);
  17. R=sort(R);
  18. [C, ii] = unique(R, 'first');
  19. XX = unique(R);
  20. YY = ii / n;
  21. YY = YY'; % траспонирование
  22. figure()
  23. plot(R, [1:n]/n);
  24.  
  25. for l=1:length(XX)
  26. line([XX(l) YY(l)],[YY(l) YY(l)]);
  27. end
  28.  
  29. figure()
  30. for i = 1:1:n
  31. ks(i) = abs((f(i) - R(i)));
  32. kv(i) = f(i) - R(i);
  33. end
  34. kss = max(ks);
  35. ksv = max(kv);
  36. plot(j, f)
  37. hold on
  38. plot(R, [1:n] / n);
  39. xlabel('zn CB')
  40. ylabel('ver')
  41. hold on
  42. plot(R, [1:n] / n - kss, 'k');
  43.  
  44. P = 1 - 2 * exp(-2n0.0786^2);
  45. FK = xcorr(R,'coeff');
  46. FT = xcorr(sort(G),'coeff');
  47. figure()
  48. plot(FK);
  49. xlim([0 2 * n])
  50. hold on
  51. plot(FT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement