It is necessary to capture the output of the Empirical cumulative distribution function so that you manage its rendering over a plot manually.
[f,x] = ecdf(y) returns the empirical cumulative distribution function (cdf), f, evaluated at the points in x, using the data in the vector y. For example, for plotting in Red with line width of 3 and blacK using a line width of 2:
figure
hold on
[f1,x1]=ecdf(NPV_Mat1);
plot(x1,f1,'r','LineWidth',3)
[f2,x2]=ecdf(NPV_Mat2);
plot(x2,f2,'k','LineWidth',2)
hold off
Of course, you can use a for-loop to do it on a big number of variables.
Best Answer