% create probability distribution object
pd = makedist('Uniform', 0, 1);
% plot cdf
t = 0:0.01:1;
cdf_of_pd = cdf(pd, t);
plot(t, cdf_of_pd)
xlabel('x')
ylabel('F(x)')
title('CDF')
% calculate probability inside range P(0.4 < x < 0.6)
prb = cdf(pd, 0.6) - cdf(pd, 0.4);
disp(prb)