what is the implication of ">0.2" and "*2-1" in (rand(N)>0.2)*2-1 ?

 Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 3 Mar 2014
Edited: Azzi Abdelmalek on 3 Mar 2014
Suppose N=[0.11 0.23 0.25 0.05 0.5]
N>=0.2
The result is
0 1 1 0 1
If you multiply the result by 2 you will get
0 2 2 0 2
and so on

1 Comment

satish
satish on 3 Mar 2014
Edited: satish on 3 Mar 2014
many thanks for prompt reply

Sign in to comment.

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Products

Asked:

on 3 Mar 2014

Edited:

on 3 Mar 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!