Subscript indices must either be real positive integers or logicals
Show older comments
Hi all,
I'm trying to do the following:
% simulate a Poisson process with rate \lambda = 3/2
lambda = 3/2;
% MATLAB function poissrnd uses the waiting time method
random_sample = poissrnd(lambda, 1, 4000)
% estimate the distribution
p = poisscdf(random_sample, lambda)
% plot the distribution
x = min(random_sample):1:max(random_sample)
y = double(poisscdf(x, lambda))
z = x+1
plot(z,y)
but I keep getting this error message. Does anyone know what could the problem be?
Thanks a lot!
Accepted Answer
More Answers (0)
Categories
Find more on Poisson Distribution in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!