obtaining values major than 10e-7
13 次查看(过去 30 天)
显示 更早的评论
I use rand function to generate values
x = rand;
after that I compared generated values to
10e-7
if x > 10e-7
do something
end
unfortunately rand generates values always bigger 10e-7. How can I generate values that are less than 10e-7 using rand function?
1 个评论
回答(1 个)
Azzi Abdelmalek
2012-9-15
x = rand*10e-7
3 个评论
Azzi Abdelmalek
2012-9-15
编辑:Azzi Abdelmalek
2012-9-15
x = 2*rand*10e-7
%you will have randomly > or <
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!