Why am I getting the following error when I am using function for generating random number?
显示 更早的评论
x = random('Poisson',1:100,1,10);
Error using poissrnd (line 28)
Size information is inconsistent.
Error in prob.PoissonDistribution.randfunc (line 177)
[varargout{1:nargout}] = poissrnd(varargin{:});
Error in random (line 140)
r = feval(spec.randfunc,varargin{:});
回答(1 个)
You must try either
x = random('Poisson',1:100,1,100);
or
x = random('Poisson',1:10,1,10);
doc random
类别
在 帮助中心 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!