How I generate a random number between 300 and 450?

Illustration
zeezo - 2022-04-23T09:45:09+00:00
Question: How I generate a random number between 300 and 450?

Hi   I would like to generate a number between 300 and 450.   I also would like which is the possible ways to generate numbers on Matlab? Is there a Poisson generator for random numbers?   And what does the initial seed mean?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

You can create a "truncated" Poisson distribution that is based on the regular Poisson distribution, but with its range truncated to a given interval and its probability density function (PDF) adjusted so that the distribution remains a proper one (i.e., its integral over the truncation range equals 1).
 
For example, to generate numbers in the range [300, 450] from a truncated Poisson distribution, you could use
 
 
% Regular Poisson distribution
lambda = (300+450)/2; % To put the mean in the middle of the range
d = makedist('poisson', 'lambda', lambda)

% Truncated Poisson distribution
td = d.truncate(300, 450)
td.random(10,1) % Generate 10 random numbers in the range [300 450]

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!