%Example 2.4
disp 'Uniform PDF over the interval 0 to 10 with the corresponding CDF';
%First get the domain over which we will evaluate the fubction.
x = -1:.1:11;
%Now get the probability density function values at x
pdf = unifpdf(x,0,10);
%Now get the cdf
cdf = unifcdf(x,0,10);
%Do the plots.
subplot(1,2,1),plot(x,pdf)
title('PDF')
xlabel('X'), ylabel('f(X)')
axis([-1 11 0 0.2])
axis square %same length x n y axis
subplot(1,2,2),plot(x,cdf)
title('CDF')
xlabel('X'), ylabel('F(X)')
axis([-1 11 0 1.1])
axis square