lognrnd(2.3,0.8,[5000,1]), I do not want the value which samller than 1.5? How can I do?
2 次查看(过去 30 天)
显示 更早的评论
I want to do something before random values are produced rather than to eliminate them after being produced?
Thank you very much!
0 个评论
回答(1 个)
ankit agrawal
2015-5-1
You can do something like this
a=lognrnd(2.3,0.8,[5000,1]);
index=1;
for i=1:length(a);
if a(i)>=1.5;
b(index)=a(i);
index=index+1;
end;
end
Where b has no value less than 1.5
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!