Complete the code to create a normal distribution with mean 0 and standard deviation 1.
pd = makedist('Normal', 'mu', [1], 'sigma', 1);
The mean (mu) of the normal distribution is 0, so we fill in 0.
Complete the code to calculate the probability density function (pdf) at x = 2 for the distribution pd.
y = pdf(pd, [1]);We want the pdf value at x = 2, so we fill in 2.
Fix the error in the code to generate 5 random samples from the distribution pd.
samples = random(pd, [1], 1);
To generate 5 samples, the first dimension should be 5.
Fill both blanks to create a binomial distribution with 10 trials and success probability 0.3.
pd = makedist('Binomial', 'N', [1], 'p', [2]);
Number of trials N is 10 and probability p is 0.3.
Fill all three blanks to create a Poisson distribution with mean 4, calculate the pdf at x=3, and generate 4 random samples.
pd = makedist('Poisson', 'lambda', [1]); y = pdf(pd, [2]); samples = random(pd, [3], 1);
Lambda (mean) is 4, pdf evaluated at 3, and 4 samples generated.
