Probability distributions are statistical techniques that measure an event’s occurrences in a specified time or space interval. The probability distributions have two types; continuous and discrete. The types of continuous probability distribution are Normal and exponential distributions. While the types of discrete probability distribution are Poisson and Binomial distributions.
Today, we will discuss how to use Poisson distribution in MATLAB. So we are going to explore:
 What is Poisson Probability Distribution?
 Why do we Need the Poisson Probability Distribution?
 How to Use Poisson Distribution in MATLAB and Simulink?
 How to Use Poisson Distribution to Probability Distribution Object?
 Example 1: How to Create a Poisson Probability Distribution Object for the Default Lambda Value?
 Example 2: How to Create a Poisson Probability Distribution Object for the Specified Lambda Value?
 How to Use Poisson Distribution to Calculate Poisson Probability Density Function?
 Example: How to Compute Poisson Density Function in MATLAB?
 How to Use Poisson Distribution to Create Random Numbers?
 Example 1: How to Create a Scalar Random Number Using the Poisson Probability Distribution?
 Example 2: How to Create an Array of Random Numbers Using the Poisson Probability Distribution?
 Conclusion
What is Poisson Probability Distribution?
The Poisson distribution is a form of discrete probability distribution that provides the probability of the occurrence of an event for a certain number of times in the time or space interval. This distribution gives the probability of countable(discrete) outcomes. It has only one parameter that is denoted by Â and called lambda which represents the mean and variance of this distribution.
Why do we Need the Poisson Probability Distribution?
The Poisson distribution has many applications in our daily life such as it is used:

 To predict text messages per hour.
 To predict the number of packets lost per minute in a network.
 To predict the number of website visitors per day.
 To predict COVID19 cases per month.
How to Use Poisson Distribution in MATLAB and Simulink?
The Poisson distribution can be implemented in MATLAB and Simulink to:

 Create a Poisson probability distribution object.
 Calculate a Poisson probability density function.
 Create random numbers Using the Poisson distribution.
How to Use Poisson Distribution to Create Poisson Probability Distribution Object?
The Poisson probability distribution object includes a model description, parameters, and sample data. This object can be created in MATLAB using the builtin makedist() function.
Syntax
The makedist() function follows a simple syntax to create a Poisson probability distribution object in MATLAB:
pd = makedist(â€˜poissonâ€™,â€™lambdaâ€™,Value)
Here,
The function pd=makedist(â€˜Poissonâ€™) is responsible for creating the Poisson probability distribution object. It uses the default lambda value which is 1. where lambda is a Poisson distribution parameter that represents the mean.
The function pd=makedist(â€˜Poissonâ€™, â€˜lambdaâ€™, Value) is responsible for creating a Poisson probability distribution object. Here, we can specify the lambda value of our own choice.
Example 1: How to Create a Poisson Probability Distribution Object for the Default Lambda Value?
This example implements the pd = makedist(â€˜Poissonâ€™) function to create a Poisson distribution object for the default lambda value that is 1.
Example 2: How to Create a Poisson Probability Distribution Object for the Specified Lambda Value?
In this MATLAB code, we create a Poisson distribution object for the value lambda=10 using the function pd=makedist(â€˜Poissonâ€™, â€˜lambdaâ€™, Value).
How to Use Poisson Distribution to Calculate Poisson Probability Density Function?
The Poisson probability density function can be defined as:
Where,

 Î» represents the Poisson distribution parameter.
 X represents the happening of a random event.
The Poisson probability density function can be computed in MATLAB using the poisspdf() function. This function accepts x and lambda as mandatory parameters and returns a Poisson probability density function calculated by the abovegiven formula.
Syntax
To calculate a Poisson probability density function, the poisspdf() can be implemented through the given syntax in MATLAB.
Here,
The function y=poisspdf(x, lambda) is responsible for calculating the Poisson probability density function at each x value using the parameter lambda. Both parameters x and lambda can be scalar, vector, matrices, or multidirectional arrays having the same size. If one argument is scalar and the other is an array, this function expands the scalar to the constant array having the same size as the other argument.
Example: How to Compute Poisson Density Function in MATLAB?
Consider a problem that in a classroom 3 students sit in a row on average. Calculate the Poisson probability density function for each student count from 1 to 5.
To solve this problem, the example below creates a vector containing the number of students from 1:5 and calculates the values of the Poisson probability density function at each value of the vector student using the poisspdf() function. After that, it uses the plot() function to plot the values of the Poisson probability density function against the number of students.
y = poisspdf(students,3)
plot(students,y)
How to Use Poisson Distribution to Create Random Numbers?
The Poisson distribution allows us to create random numbers in MATLAB using the builtin poissrnd() function. This function accepts the Poisson distribution parameter Â lambda as a mandatory argument and creates a scalar or an array of random numbers using the Poisson distribution.
Syntax
The poissrnd() uses the given syntaxes to create Poisson distribution random numbers in MATLAB.
r = poissrnd(lambda,sz1,...,szN)
Here,
The function r=poissrnd(lambda) is responsible for creating a scalar random number from the Poisson distribution using the scalar value of lambda. In general, lambda can be a scalar, a vector, or a multidirectional array. This function generates an array of random numbers having the same size as the size of lambda.
The function r=poissrnd(lambda,sz1,…,szN) is responsible for creating an array of Poisson distribution random numbers. Hee, sz1,…,szN represent the array size and lambda is a scalar value.
Example 1: How to Create a Scalar Random Number Using the Poisson Probability Distribution?
In this example, we use the poissrnd(lambda) function to create a scalar random number using lambda=10.
Example 2: How to Create an Array of Random Numbers Using the Poisson Probability Distribution?
The belowgiven MATLAB code creates an array of random numbers using the poissrnd(lambda,sz1,…,szN) function. Here, lambda is a scalar value that is 10 while the size of the array is 2by4by2.
Conclusion
Poisson probability distribution predicts the probability of the occurrence of an event for a certain number of times in a specified time or space interval. In MATLAB, it is used to create a Poisson probability distribution object and random numbers and calculate the value of the Poisson probability density function. This guide explored the uses of Poisson distribution in MATLAB with the help of practical examples.