How to generate random number from Bernoulli distribution?
    32 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    PARVATHY NAIR
 am 19 Jan. 2023
  
    
    
    
    
    Beantwortet: Bruno Luong
      
      
 am 19 Jan. 2023
            just like the below command
a=randn(1,1000)
how can we generate random number from bernoulli distribution
0 Kommentare
Akzeptierte Antwort
  Bruno Luong
      
      
 am 19 Jan. 2023
        p = 0.25
X = double(rand(1,1000) < p)
histogram(X,'Normalization','pdf')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


