t = truncate(pd,lower,upper)
returns a probability distribution t, which is the probability
distribution pd truncated to the specified interval with lower
limit, lower, and upper limit,
upper.
pd — Probability distribution probability distribution object
Probability distribution, specified as a probability distribution object.
Create a probability distribution object with specified parameter values using
makedist.
Alternatively, for a fittable distribution, create a probability
distribution object by fitting it to data using fitdist or the Distribution Fitter app.
lower — Lower truncation limit scalar value
Lower truncation limit, specified as a scalar value.
Data Types: single | double
upper — Upper truncation limit scalar value
Upper truncation limit, specified as a scalar value.
t — Truncated distribution probability distribution object
Truncated distribution, returned as a probability distribution object. The
probability distribution function (pdf) of t is 0
outside the truncation interval. Inside the truncation interval, the pdf of
t is equal to the pdf of pd,
but divided by the probability assigned to that interval by
pd.
The object properties of t are
the same as those of pd with these exceptions:
The Truncation property of
t stores the truncation
interval.
The IsTruncated property of
t is 1.
The InputData property of
t is empty. For a fitted distribution
object, the InputData property stores the
data used for distribution fitting. The truncated distribution
object does not store the input data.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
The input argument pd can be a fitted probability
distribution object for beta, exponential, extreme value, lognormal, normal,
and Weibull distributions. Create pd by fitting a
probability distribution to sample data from the fitdist function. For an
example, see Code Generation for Probability Distribution Objects.
A truncated probability distribution object cannot be an input argument of
an entry-point function. To evaluate a truncated distribution using object
functions such as cdf, pdf,
mean, and so on, call truncate
and one or more of these object functions within a single entry-point
function.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.