How I generate a random number between 300 and 450?

Z
zeezo · Apr 23, 2022 · 2K views
Question
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 PhD Expert
Answered Aug 31, 2026
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]

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!