Exponential distributed random values
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Furkan Karaman
 il 22 Nov 2020
  
    
    
    
    
    Modificato: John D'Errico
      
      
 il 22 Nov 2020
            Hello,
I read in my script the following for creating exponential distributed random values:
n=50;   %number of summands
n_exp=1000;   %number of experiments
mu=rand(n,1)+0.5;  %random means between 0.5 and 1.5
sigma=mu;        %for exponential distribution
x=exprnd(repmat(mu,1,n_exp),n,n_exp);  &exponential distributed random values for every experiment
 n and n_exp are defining the size of the array but can anyone explain why I have to use repmat(mu,1,n_exp)?
0 Commenti
Risposta accettata
  John D'Errico
      
      
 il 22 Nov 2020
        
      Modificato: John D'Errico
      
      
 il 22 Nov 2020
  
      You need to do that since your exponential rate parameter varies. If it were constant, this would not be necessary.  The first argument would just then be a scalar.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Random Number Generation in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

