clear all

A = csvread('mc1.csv');
B = csvread('mc2.csv');
abc = csvread('abc.csv');
dco = csvread('dco.csv');
nbins = 100;

[y1, x1] = hist(A, nbins);
[y2, x2] = hist(B, nbins);

abc2 = zeros(2, 3);

for i = 1:2
	c = dco(i, 1);
	d = sqrt(6 * dco(i, 2));
	abc2(i, 1) = c - d;
	abc2(i, 3) = c + d;
	abc2(i, 2) = c;
end

addpath('~/matlab2tikz');

figure(10)
hold off
plot(x1, y1 ./ max(y1), 'b')
hold on
plot(abc(1, :), [0, 1, 0], 'r')
plot(abc2(1, :), [0, 1, 0], 'k')

legend('Monte Carlo', 'Fuzzy Set', 'Moments Propagation', 'location', 'northwest')
matlab2tikz('input.tex', 'height', '\figureheight', 'width', '\figurewidth');

figure(20)
hold off
plot(x2, y2 ./ max(y2), 'b')
hold on
plot(abc(2, :), [0, 1, 0], 'r')
plot(abc2(2, :), [0, 1, 0], 'k')

legend('Monte Carlo', 'Fuzzy Set', 'Moments Propagation', 'location', 'northeast')
matlab2tikz('output.tex', 'height', '\figureheight', 'width', '\figurewidth');
