Create a two-point distribution?
Afficher commentaires plus anciens
I want to multiply each element of a vector by a random variable X that takes values +1 and -1 with probability 1/2. How do I create this random variable?
Réponses (1)
dk
le 17 Oct 2019
1 vote
N=100;
x=sign(rand(N,1)-0.5);
1 commentaire
kevin cecere palazzo
le 17 Oct 2019
Catégories
En savoir plus sur Inverse Gaussian Distribution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!