function F = quadratic_cdf(x, params )
%    F = quadratic_cdf(x, [ a, b, c ] )
% 
%    Return the CDF of a quadratic distribution with parameters a and b
%    with limits a < x < b, which must be scalars.

 a = params(1);
 b = params(2);

 F = zeros(size(x));

 idx1 = find(x>b);
 idxx = find( (a<=x) & (x<=b) );
 x = x(idxx);

 F(idxx) = (a-x).^2 .* (a-3*b+2*x) / (a-b)^3;
 F(idx1) = 1;

% ------------------------------------------------------------ quadratic_cdf 
% HP Gavin 2023-02-14

