I need ziggurat matlab code to draw
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, i need a ziggurat matlab code to generate somehing like this
i'm working with (gauss) random number generator ziggurat rejection method
0 Commenti
Risposta accettata
Chunru
il 17 Mag 2022
Modificato: Chunru
il 17 Mag 2022
where is a normalizing constant that we can ignore.
x = [0:.1:2]
y = 1/(2*pi)*exp(-x.^2/2);
stairs(x, y, 'b');
hold on
xl = xlim;
plot([xl(1)*ones(1, length(x)-1); x(2:end)], [y(2:end); y(2:end)], 'b')
% longer tais
x = [0:.1:4]
y = 1/(2*pi)*exp(-x.^2/2);
plot(x, y, 'r')
8 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!