obtaining values major than 10e-7
12 views (last 30 days)
Show older comments
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 Comment
Answers (1)
Azzi Abdelmalek
on 15 Sep 2012
x = rand*10e-7
3 Comments
Azzi Abdelmalek
on 15 Sep 2012
Edited: Azzi Abdelmalek
on 15 Sep 2012
x = 2*rand*10e-7
%you will have randomly > or <
See Also
Categories
Find more on Signal Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!