%% Specify Piecewise Linear Distribution Object
% Create a piecewise linear distribution object for a distribution with values from 6 to 10, where values from 6 to 8 are four times more likely than values from 8 to 10.

pd = makedist('PieceWiselinear','x',[6 8 10],'Fx',[0 0.8 1]);

% You specify the cumulative distribution function Fx as [0 0.8 1] because the difference between 0.8 and 0 is four times the difference between 1 and 0.8. As a result, the generated distribution has four times more values between 6 to 8 than between 8 to 10.
% The plot shows the specified cumulative distribution function (CDF) and the corresponding probability distribution function (PDF).
%
% The piecewise linear CDF corresponds to a piecewise constant PDF.
% Copyright 2012 The MathWorks, Inc.