Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- x = csvread('X.txt');
- %x = [x zeros(1,200)+6.5];
- M_min = min(x);
- M_max = max(x);
- R = range(x);
- MX = mean(x);
- DX = var(x);
- sigma = sqrt(DX);
- fprintf('M_min = %.2f\nM_max = %.2f\nR = %.2f\n', M_min, M_max, R);
- fprintf('MX = %f\nDX = %f\n', MX, DX);
- % Определение промежутков разбиения
- J_m = floor(log2(length(x))) + 2;
- [y1, x1] = hist(x, J_m);
- y1 = y1/(sum(y1)*(x1(2) - x1(1)));
- step = sigma/100;
- % Маштобирование для графиков
- xnorm = M_min:step:8;
- ynormp = normpdf(xnorm, MX, sigma);
- ynormc = normcdf(xnorm, MX, sigma);
- figure
- bar(x1, y1, 1);
- hold on;
- plot(xnorm, ynormp, 'r');
- hold off;
- figure
- ecdf(x);
- axis tight;
- hold on;
- plot(xnorm, ynormc, 'r');
- hold off;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement